I created a widget that when clicked activates a PendingIntent. The problem is when I have more than one widget on the screen only the latest one will start the PendingIntent.
I have read some about a unique request code, but not figured this out.
Any ideas how I can have multiple widgets and the PendingIntents work for each?
Here is a snippet of my code:
Intent openApp = new Intent(context, RunningTally.class);
openApp.putExtra("widgetId", appWidgetId);
PendingIntent pendingAppIntent =
PendingIntent.getActivity(context, 0, openApp, PendingIntent.FLAG_CANCEL_CURRENT );
views.setOnClickPendingIntent(R.id.openFull, pendingAppIntent);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…