OK, so I have done some research and the consensus seems to be that you can't update android:updatePeriodMillis
programatically.
It seems that you have to use AlarmManager
instead, which seems like using a sledghammer to crack a nut... odd that the API doesn't just let you update the core updatePeriodMillis
.
There's always a slight risk with relying on what's out there on the web, since APIs tend to develop and old answers are no longer relevant.
So I'm just checking that this is still the case. For example, the guide at http://developer.android.com/guide/topics/appwidgets/index.html at least hints that it is possible to change the update period of the AppWidgetProvider
. When discussing updatePeriodMillis
it says:
"You might also allow the user to adjust the frequency in a configuration—some people might want a stock ticker to update every 15 minutes, or maybe only four times a day."
And then goes on to talk about using AlarmManager
but apparently only in relation to avoiding waking the device rather than to changing the update period.
Thanks for any help on this.