[Android] Widget : Fix cover onclick to launch the app

Alexandre Perraud git at videolan.org
Wed Jun 3 16:56:18 CEST 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Wed Jun  3 16:50:20 2015 +0200| [63e20972d689fe144474c52e64425c502d9383dc] | committer: Alexandre Perraud

Widget : Fix cover onclick to launch the app

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

 .../src/org/videolan/vlc/widget/VLCAppWidgetProvider.java       |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.java b/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.java
index f3050c4..e968708 100644
--- a/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.java
+++ b/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.java
@@ -35,6 +35,8 @@ import android.widget.RemoteViews;
 import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.vlc.BuildConfig;
 import org.videolan.vlc.R;
+import org.videolan.vlc.VLCApplication;
+import org.videolan.vlc.gui.MainActivity;
 
 public class VLCAppWidgetProvider extends AppWidgetProvider {
     public static final String TAG = "VLC/VLCAppWidgetProvider";
@@ -50,8 +52,6 @@ public class VLCAppWidgetProvider extends AppWidgetProvider {
     public static final String ACTION_WIDGET_UPDATE_POSITION = "org.videolan.vlc.widget.UPDATE_POSITION";
 
     public static final String VLC_PACKAGE = "org.videolan.vlc";
-    public static final String VLC_PLAYER = "org.videolan.vlc.gui.audio.AudioPlayerActivity";
-    public static final String VLC_MAIN = "org.videolan.vlc.gui.MainActivity";
 
     @Override
     public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
@@ -85,8 +85,7 @@ public class VLCAppWidgetProvider extends AppWidgetProvider {
             Intent iPlay = new Intent(ACTION_REMOTE_PLAYPAUSE);
             Intent iStop = new Intent(ACTION_REMOTE_STOP);
             Intent iForward = new Intent(ACTION_REMOTE_FORWARD);
-            Intent iVlc = new Intent();
-            iVlc.setClassName(VLC_PACKAGE, VLC_MAIN);
+            Intent iVlc = new Intent(VLCApplication.getAppContext(), MainActivity.class);
             iVlc.putExtra(START_FROM_NOTIFICATION, true);
 
             PendingIntent piBackward = PendingIntent.getBroadcast(context, 0, iBackward, PendingIntent.FLAG_UPDATE_CURRENT);



More information about the Android mailing list