Hello everybody
I try to write a widget that opens a configure activity when touched.
Of course I ran into the bug with the widget id's not being properly
deleted but I have the feeling I also have trouble with a variant of
it:
When I clear my home screen from all widgets of my type and then add a
new single widget things look fine at the first glance.
But when I touch the widget I see the activity opening with a widget
ID of an old, already removed widget.
Of course I am then unable to relate the settings made in the activity
with the widget on the screen (at least when I plan for the
possibility of more than one widget existing).
This is what I do:
...
// Create an Intent to launch the config activity
Intent intent = new Intent(context, ConfigActivity.class);
intent.putExtra("WidgetId", appWidgetId);
PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.textView1,
pendingIntent);
views.setOnClickPendingIntent(R.id.widgetBackground,
pendingIntent);
appWidgetManager.updateAppWidget(appWidgetId, views);
....
This code is called everytime I want to update a widget. It is ONLY
called for widgets that I know to be active (keeping my own list in
PreferrredResources for housekeeping)
Has anybody seen similar problems and might even have an idea how to
circumvent it?
Or simple can tell me what I might do wrong?
Besrt regards
Gerhard
--
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