[Android] Fix java.lang.NullPointerException in MainActivity.java
Jean-Baptiste Kempf
git at videolan.org
Wed Apr 2 20:08:48 CEST 2014
vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Apr 2 20:05:32 2014 +0200| [2ccd5ac5f7322d051d8b9f488448c089bbcf3a03] | committer: Jean-Baptiste Kempf
Fix java.lang.NullPointerException in MainActivity.java
---
java.lang.NullPointerException
at org.videolan.vlc.betav7neon.gui.MainActivity.showSecondaryFragment(MainActivity.java:520)
at org.videolan.vlc.betav7neon.gui.audio.AudioBrowserFragment$3.onItemClick(AudioBrowserFragment.java:186)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1114)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2937)
at android.widget.AbsListView$1.run(AbsListView.java:3695)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:4987)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
at dalvik.system.NativeStart.main(Native Method)
at Android.MODEL(B1-A71)
at Android.VERSION(4.1.2)
at Android.FINGERPRINT(acer/B1-A71_ww_gen1/B1-A71:4.1.2/JZO54K/1364901657:user/release-keys)
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=2ccd5ac5f7322d051d8b9f488448c089bbcf3a03
---
vlc-android/src/org/videolan/vlc/gui/MainActivity.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index e40d0b2..28a2459 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -518,12 +518,14 @@ public class MainActivity extends SherlockFragmentActivity {
// Slide down the audio player if needed.
slideDownAudioPlayer();
- // Do not show the new fragment if the requested fragment is already shown.
- if (mCurrentFragment.equals(fragmentTag))
- return null;
+ if (mCurrentFragment != null) {
+ // Do not show the new fragment if the requested fragment is already shown.
+ if (mCurrentFragment.equals(fragmentTag))
+ return null;
- if (!secondaryFragments.contains(mCurrentFragment))
- mPreviousFragment = mCurrentFragment;
+ if (!secondaryFragments.contains(mCurrentFragment))
+ mPreviousFragment = mCurrentFragment;
+ }
mCurrentFragment = fragmentTag;
Fragment frag = fetchSecondaryFragment(mCurrentFragment);
More information about the Android
mailing list