stop the widget from running in the background, on delete()

别等时光非礼了梦想. 提交于 2019-12-11 23:51:16

问题


Hey, Anyone knows how to kill widget on delete(). When i delete the widget its stays running in the background,it never dies unless i foreclose the whole app. My app consists of 4 activities and the widget is not the main activity and im using thread instead of service for the appwidget.

All what i need is stop the widget from running in the background when i delete it. i've tried using system.exit(0). It didn't work, all what it does is clear all the data in the widget. Or if i can kill the app ondelete();

Any ideas? I'd really appreciated.


回答1:


That is the normal behavior. The process is kept around in case the app needs to run again. This saves work, since it can probably just be re-used the next time the widget needs to update or the user launches the app.



来源:https://stackoverflow.com/questions/4710043/stop-the-widget-from-running-in-the-background-on-delete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!