Is ArrayList safe to use in this context?
Not. If no other application is running, your process may be interrupted between calls to onUpdate() .
Are there any widget lifecycle events that will lead to an instance of the list.
Your process has been interrupted.
I find it very difficult to find documentation on Widget Lifecycle events.
This is because there is no life cycle in the way you think.
An AppWidgetProvider is a registered manifest of BroadcastReceiver . A registered BroadcastReceiver manifest lives only as long as its onReceive() call. Nothing that lives outside this area, such as static data members, will be reliable.
Please save the information in files or databases.
CommonsWare
source share