[Android] Avoid casting to MainActivity

Geoffrey Métais git at videolan.org
Fri May 15 17:34:30 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 15 17:32:50 2015 +0200| [dbc4a2f7b3f8882f4222e1f55c8befa256cad44b] | committer: Geoffrey Métais

Avoid casting to MainActivity

Since Advanced options dialog can now be launched on SecondaryActivity too.

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=dbc4a2f7b3f8882f4222e1f55c8befa256cad44b
---

 vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
index d3a10eb..cf1e4ad 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/AdvOptionsDialog.java
@@ -397,7 +397,9 @@ public class AdvOptionsDialog extends DialogFragment implements View.OnClickList
                 ((VideoPlayerActivity)getActivity()).switchToAudioMode(true);
                 break;
             case R.id.opt_equalizer:
-                ((MainActivity)getActivity()).showSecondaryFragment(SecondaryActivity.EQUALIZER);
+                Intent i = new Intent(getActivity(), SecondaryActivity.class);
+                i.putExtra("fragment", SecondaryActivity.EQUALIZER);
+                startActivity(i);
                 dismiss();
                 break;
         }



More information about the Android mailing list