Widget does not works after “Clear Memory”

前端 未结 1 853
南笙
南笙 2021-01-19 06:37

The problem is that after I use the built in Task Manager\'s Clean Memory/Ram, My widget stops working .I guess this is related to the Task Manager\'s method of cleaning RAM

相关标签:
1条回答
  • 2021-01-19 07:25

    Widget does not bound to application life cycle. All the widgets are bound together. If all what your widget got is a button than there is no reason for it to stop working. You problem is some place else. For some reason your button intent is fail to start what you set it to start.

    If you show me your code for setting the button, I be able to help you more, but it is another question, and you better Google for answer before posting.

    EDIT: It looks like you didn't understood the idea of widgets. Right now what your button is doing is starting the widget. It looks weird to me, I am not sure what exactly is happening there... I suggest that your button will start a completely new service. That service will show your toast. You defiantly do not need to listen for restart package broadcast.

    0 讨论(0)
提交回复
热议问题