16

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.

animuson
  • 53,861
  • 28
  • 137
  • 147
stansult
  • 1,323
  • 10
  • 18
  • 1
    Well spotted. Logically Clear Data should kill the app, so maybe this is a bug in ICS. Unless of course ICS sends some sort of notification to the app - yet more for us programmers to worry about. – Philip Sheard Mar 01 '12 at 07:36
  • @PhilipSheard Thanks! So is it safe to assume that after I hit Clear Data the app was killed as if I hit Force Close? – stansult Mar 01 '12 at 07:44
  • 1
    Well I am just guessing, but it would be darned stupid if that did not happen, wouldn't it? I am just trying to think rationally here. I do not have any inside knowledge about this. – Philip Sheard Mar 01 '12 at 07:51
  • 3
    @Philip: Why is it logical to kill the app when clearing data? I can understand a scenario where it may be desirable but should that be the case every time? Clearing data on my Froyo phone doesn't make the 'Force Close' button disabled. – Squonk Mar 01 '12 at 07:52
  • @MisterSquonk - Oh, you’re right, I forgot to check Froyo. – stansult Mar 02 '12 at 06:32
  • @MisterSquonk - Hm, interesting. So it behaves the same way on Froyo (I tried 2.2.2) and ICS (4.0.2), but does disable Force Close button after clearing data on several Gingerbread phones I checked (2.3.4, 2.3.5, 2.3.6 — more than one device for some of these). – stansult Mar 02 '12 at 06:38
  • 1
    @stansult: I'm not sure why Gingerbread would do this perhaps it was a design decision which they decided to reverse. I have no idea if Honeycomb acts the same way. When debugging my current app on my Froyo phone I often use Clear Data but don't Force Close as I have an `Application` object which maintains some stuff I don't want cleared. If I want to start from a 'vanilla' first-run state without re-installing though I can clear the data and force close. I'm happy that I can do one or both separately in this case. PS, I added the gingerbread tag. – Squonk Mar 03 '12 at 00:33
  • @MisterSquonk Just to make sure, checked Honeycomb as well — same result (does not disable Force Close after clearing data). – stansult Mar 06 '12 at 02:34
  • 1
    @stansult: Interesting to know, thanks for the update. – Squonk Mar 06 '12 at 05:24

2 Answers2

14

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.

hackbod
  • 90,665
  • 16
  • 140
  • 154
  • @hackbog, thanks! that makes sense if that’s the case. Do you know any source to read about this (Force Close definition change)? – stansult Mar 14 '12 at 02:09
  • 1
    I just confirmed that "Clear Data" does kill the app. Note that `onDestroy()` is **not** called on any of the running activities. – ThomasW Jul 22 '16 at 02:53
0

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

Nikhil
  • 16,194
  • 20
  • 64
  • 81
TulasiRam
  • 21
  • 1
  • 3