Android onEnabled () life cycle after process was killed

According to the documentation, the life cycle of the AppWidgetProvider class is managed by the Android platform. The documentation also states that the lifecycle onEnabled () method is called only once. But what about widgets that were deleted because the Android platform recovered its memory? In this case, when the widget is activated again (for example, some intention is received or someone clicked on the widgets), will the onEnabled () method be called again?

+4
source share
1 answer

NO! Answer Simple No. I recently started working with widgets. and I learned the basics and in accordance with this. onEnabled () is jst as the onCreate method whenever you close and reopen the widget / activity called by the onEnabled / onCreate method.

onEnabled (context context): called when the first application widget is created. Global initialization should be done here, if applicable.

Link: http://www.developer.com/ws/article.php/3833306/Creating-a-Home-Screen-App-Widget-on-Android.htm

Thanks: Hope I helped U. Dont Mark this answer as correct So the other also knows the correct answer!

0
source

All Articles