I am writing a widget with configuration activity that calls the following method when I click OK :
private void ok() {
This is almost verbatim from the documentation . widget_id contains the widget id that was dug during the onCreate() action.
When I put the widget instance on the main screen, I checked that I was getting the expected sequence of events:
onReceive() gets ACTION_APPWIDGET_ENABLED if it is the first.onUpdate() is called (in which I find that the widget is not configured and draws something as the default action).- The configuration action appears.
- When I click
OK , the ok() method above is called.
The method reaches finish() and the configuration activity disappears, but after that there is no call to onUpdate() or onReceive() . (The widget itself does not have updatePeriodMillis .) I get a widget on the screen that has the results of my default action, but never updates.
If I installed the widget without configuration activity, it will be updated at creation and everything will work as expected (just without the configured bits).
Am I missing something in how to force update?
Thanks!
android android widget
Blfl
source share