Android AppWidget onUpdate on boot

Is onUpdate AppWidget called on boot?

I set an alarm in onUpdate, and I wanted to know if the onUpdate call would be called at boot time or should I use the BOOT_COMPLETED intent.

Thanks.

+4
source share
1 answer

I did not find anything in the docs about this, so I just checked it. I set Toast in the onUpdate() method of my widget to see when it fires. After the device restarts, it is activated, so I assume that you do not need to use the BOOT_COMPLETED intent, but sometimes you cannot be sure (there is nothing against using it).

Edit:

onUpdate () makes a call at startup, and Android docs close this:

Onupdate ()

Called in response to ACTION_APPWIDGET_UPDATE and ACTION_APPWIDGET_RESTORED broadcasts when this AppWidget provider is asked to provide RemoteViews for a set of AppWidgets. Override this method to implement your own AppWidget functionality.

A source

ACTION_APPWIDGET_UPDATE

This can be sent in response to a new instance for this created AppWidget provider, the requested update interval has expired or the system has booted.

A source

+4
source

All Articles