My Android widget is killed: "Bellander.andro is no longer needed ..."

I am writing a widget that retrieves data from a web page every 5 minutes using a timer. It works fine for an hour or two, then the process is killed.

I/ActivityManager(81): No longer want bellander.android.widget (pid 1118): hidden #16

and systemic kill process. How can I prevent this? Improper use of the timer?

+3
source share
1 answer

I am writing a widget that retrieves data from a web page every 5 minutes using a timer

Use for this AlarmManager. Do not try to use the service (or, worse, AppWidgetProvider) live forever .

, . , , , .

+1

Source: https://habr.com/ru/post/1757621/


All Articles