4747 */
4848public class Widget extends AppWidgetProvider {
4949
50- private static final String TAG = Widget .class .getSimpleName ();
51-
5250 private static final String LIST_ITEM_CLICK = "list_item" ;
5351 private static final String ITEM_ARG = "item_extra" ;
5452
@@ -64,17 +62,18 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a
6462 RemoteViews widget = new RemoteViews (context .getPackageName (), R .layout .widget_profile );
6563 widget .setRemoteAdapter (R .id .profile_list , svcIntent );
6664
67- widget .setPendingIntentTemplate (R .id .profile_list , getPendingIntent (context , LIST_ITEM_CLICK ));
65+ widget .setPendingIntentTemplate (R .id .profile_list , getPendingIntent (context ));
6866
6967 appWidgetManager .updateAppWidget (appWidgetId , widget );
7068 }
7169 }
7270
73- private PendingIntent getPendingIntent (Context context , String action ) {
71+ private PendingIntent getPendingIntent (Context context ) {
7472 Intent intent = new Intent (context , getClass ());
75- intent .setAction (action );
73+ intent .setAction (LIST_ITEM_CLICK );
7674 return PendingIntent .getBroadcast (context , 0 , intent , Build .VERSION .SDK_INT >=
77- android .os .Build .VERSION_CODES .M ? PendingIntent .FLAG_MUTABLE : 0 );
75+ android .os .Build .VERSION_CODES .M ? Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .S ?
76+ PendingIntent .FLAG_MUTABLE : PendingIntent .FLAG_IMMUTABLE : 0 );
7877 }
7978
8079 @ Override
0 commit comments