[Android] Launch the audio player activity when the widget's cover is pressed.

Ludovic Fauvet git at videolan.org
Wed Jul 4 13:36:08 CEST 2012


android | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Jul  4 13:18:36 2012 +0200| [aa380bd76b77ec97380463122f133c2f25b57a29] | committer: Ludovic Fauvet

Launch the audio player activity when the widget's cover is pressed.

... but only if a media is loaded. Fallback to the main activity if
there's nothing to play.

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

 vlc-android/src/org/videolan/vlc/AudioService.java |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 4c31168..ea17c9e 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -737,7 +737,8 @@ public class AudioService extends Service {
         iStop.setAction(VLCAppWidgetProvider.ACTION_WIDGET_STOP);
         Intent iForward = new Intent();
         iForward.setAction(VLCAppWidgetProvider.ACTION_WIDGET_FORWARD);
-        Intent iVlc = new Intent(context, MainActivity.class);
+        Class<?> cls = (mCurrentMedia != null) ? AudioPlayerActivity.class : MainActivity.class;
+        Intent iVlc = new Intent(context, cls);
         iVlc.putExtra(START_FROM_NOTIFICATION, true);
 
         PendingIntent piBackward = PendingIntent.getBroadcast(context, 0, iBackward, PendingIntent.FLAG_UPDATE_CURRENT);



More information about the Android mailing list