Does an onUpdate AppWidget called on boot?
I’m setting an alarm in the onUpdate and I wanted to know if the onUpdate will get called on boot or should I use the BOOT_COMPLETED intent.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I didn’t find anything in the docs regarding this so I just tested it out. I set a Toast in the
onUpdate()method of my widget to see when it’s triggered. After restarting the device it got triggered, so I assume that you don’t need to use theBOOT_COMPLETEDintent, but sometimes you can’t be sure enough(there is nothing against still using it).Edit:
onUpdate() does get called on boot and the Android docs do cover this:
onUpdate()
Source
ACTION_APPWIDGET_UPDATE
Source