I have this simple widget and when I click on it, it should open my activity, it works, but it doesn\'t work after reboot. I must delete and then again add widget to my home
The AppWidgetProvider which widgets inherit calls onUpdate
on startup when it receives ACTION_APPWIDGET_UPDATE
from the operating system.
If you override onReceive
without calling super.onReceive()
, you would need to intercept this Intent on your own.
After reboot you OnEnabled is called instead of onUpdate so move the code from onUpdate into a separate method and then call that method to update all widgets from onEnabled