[Android] MainActivity: fix NPE due to a race

Jean-Baptiste Kempf git at videolan.org
Fri Oct 9 13:46:00 CEST 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Oct  9 13:45:42 2015 +0200| [7d5358a5fa2b5c73f1125a508531491744f6c33f] | committer: Jean-Baptiste Kempf

MainActivity: fix NPE due to a race

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

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index 5d642e3..399e376 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -536,7 +536,7 @@ public class MainActivity extends AudioPlayerContainerActivity implements OnItem
             if (resultCode == PreferencesActivity.RESULT_RESCAN)
                 mMediaLibrary.scanMediaItems(true);
             else if (resultCode == PreferencesActivity.RESULT_RESTART) {
-                Intent intent = getIntent();
+                Intent intent = new Intent(getIntent());
                 finish();
                 startActivity(intent);
             }



More information about the Android mailing list