Does “Clear Data” also kill the app?

混江龙づ霸主 提交于 2019-12-10 01:42:47

问题


When (in Gingerbread, 2.3.x) I hit “Clear Data” button in Menu => Manage Apps => App, “Force Close” button also becomes disabled. Does it mean that “Clear Data” also kills the app?

Also, I noticed that in Ice Cream Sandwich this doesn’t happen. So, the way “Clear Data” works is different between Gingerbread and Ice Cream Sandwich?

Update: as MisterSquonk said, Froyo (2.2.x) behaves the same way as ICS (4.x), that is doesn’t disable Force Close after you clear data of the app. Anyone knows why is the behavior so different? What it the bug in Gingerbread, or some temporary experiment, that killed the app together with clearing its data?

P.S. Couldn’t create “Gingerbread” tag, not enough reputation :) P.P.S. @MisterSquonk, Thanks for the tag :)

Update 2: Checked Honeycomb (3.2) as well, it also behaves the same way as Froyo as ICS. Only Gingerbread disables Force Close after clearing the data.


回答1:


Clear Data does kill the app, and always has.

"Force Stop" has gone through various iterations of meanings. It used to mean to just kill all processes and services, and clearing data would also do the same as a force stop. There were also older iterations of the platform that were not as good as figuring out when to disable the button, which is probably why you are seeing it remain enabled in 2.2.

However in 3.2 I believe the meaning of "Force Stop" change to put the application in a state where it would not be able to run until the user had done something to explicitly start it (such as launching it from launcher, selecting it as an input method, etc). When that change was made, "Clear Data" continued to just kill the processes and stop its services, so the app was not in the full stopped state so the button remains enabled.




回答2:


yes, when you click the ClearData button in Settings-->Applications-->Manage applications-->[MYApp] Tap the MyApp.. Click the Clear data button When you click the clear data button then the data will we erased/delete..... obviously when delete the data then App will go to force close



来源:https://stackoverflow.com/questions/9512193/does-clear-data-also-kill-the-app

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