Application Widget With Bundle?
Hey guys, I have application widget, and I want to send some data to the intent that is attached to PendingIntent, by clicking the widget. here's my code final int N = appWidgetIds
Solution 1:
Try using FLAG_UPDATE_CURRENT
when you create your PendingIntent
.
Solution 2:
Sorry for answering post after half a year :) For those, who will find this post when get this problem: I have found, that FLAG_UPDATE_CURRENT is not enough:
http://developer.android.com/reference/android/app/PendingIntent.html
This flag will not work if you need more then 1 widget with different data in intents bundles, because Intent will be overrwritten.
To fix this you will need to update intent data:
http://developer.android.com/guide/topics/appwidgets/index.html
// When intents are compared, the extras are ignored, so we need to embed the extras// into the data so that the extras will not be ignored.
intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
Post a Comment for "Application Widget With Bundle?"