开发者

can i write to sql database while android mobile getting switched off

开发者 https://www.devze.com 2023-04-11 04:29 出处:网络
I need to store some data while the device is shutting down, so that i could use those values after reboot.

I need to store some data while the device is shutting down, so that i could use those values after reboot.

Can i use android.intent.action.ACTION_SHUT开发者_运维技巧DOWN-intent to fullfill my requirement?


I need to store some data while the device is shutting down, so that i could use those values after reboot.

No, you need to store the data when it changes.

Devices do not always shut down cleanly (e.g., battery pops out). Also, the user can terminate your application without warning using a task killer or the Settings application. Please save the data as you go, when it changes, so you do not lose data in these cases. As a side benefit, you will no longer care about the ACTION_SHUTDOWN event.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号