I am having trouble when I add a one or more instances of my widget to the
home screen, remove them all, then add another.
Here is the code I use to set the "onClick" intent for each button (button
is a resource)
protected void matchButtonToAction(Context context, RemoteViews views,
String action, int button) {
Intent intent = new Intent(context, MightyToggleWidget.class);
intent.setAction(action);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0,
intent, 0);
views.setOnClickPendingIntent(button, pendingIntent);
}
This only happens when I remove *ALL* instances and add one. If I add 2,
remove 1 and add 1 it still works.
It is still receiving and reacting to events (such as wifi status changing
or battery events).
Any ideas what could be causing this?
Thanks!
Ash
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en