[Android] don't keep START_FROM_NOTIFICATION state in MainActivity
Sébastien Toque
git at videolan.org
Wed Jun 27 00:57:27 CEST 2012
android | branch: master | Sébastien Toque <xilasz at gmail.com> | Wed Jun 27 00:57:21 2012 +0200| [51fa547045995c80a5c2570d79f0f8b130caa18f] | committer: Sébastien Toque
don't keep START_FROM_NOTIFICATION state in MainActivity
> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=51fa547045995c80a5c2570d79f0f8b130caa18f
---
vlc-android/src/org/videolan/vlc/gui/MainActivity.java | 5 ++++-
1 file changed, 4 insertions(+), 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 58af631..f79ad9d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -182,14 +182,17 @@ public class MainActivity extends SherlockFragmentActivity {
SharedPreferences sharedPrefs = getSharedPreferences("MainActivity", MODE_PRIVATE);
mCurrentViewTab = sharedPrefs.getInt("tab", VIDEO_TAB);
mMediaLibraryActive = sharedPrefs.getBoolean("medialibrary", true);
+ Boolean startFromNotification = getIntent().hasExtra(AudioService.START_FROM_NOTIFICATION);
/* Restore last view */
if(!mMediaLibraryActive)
showDirectoryView();
- else if (getIntent().hasExtra(AudioService.START_FROM_NOTIFICATION) || mCurrentViewTab == AUDIO_TAB)
+ else if (startFromNotification || mCurrentViewTab == AUDIO_TAB)
showAudioTab();
else
showVideoTab();
+ if (startFromNotification)
+ getIntent().removeExtra(AudioService.START_FROM_NOTIFICATION);
super.onResume();
}
More information about the Android
mailing list