4

Android : which call back do we get when we click CLEAR DATA of any application ? Steps : settings > applications > my_app > clear data !

braX
  • 11,506
  • 5
  • 20
  • 33
S P
  • 854
  • 4
  • 10
  • 21

1 Answers1

0

which call back do we get when we click “CLEAR DATA” of any application ?

You do not get any "call back" specifically for this event.

That being said, I have not tried "Clear Data" with the app's process running. I would hope that "Clear Data" would terminate the process, and ideally in a graceful fashion, calling onDestroy() on your components.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • ok i will somehow try to put my code in on destroy but i m afraid that wont solve my purpose..... thnx CommonsWare – S P Jun 05 '13 at 11:06
  • @SP: I repeat: You do not get any "call back" specifically for this event. Hence, if your app is not running, you do not get any "call back" specifically for this event. Your app would treat this the same as it treats the first run after installation, as both conditions are identical (e.g., nothing in internal storage). – CommonsWare Jun 05 '13 at 11:11
  • yeahhhhh i do understand. i was just thinking over ur line about "calling onDestroy()" . thnx CommonsWare. u r a big help most of the times. \m/ – S P Jun 05 '13 at 11:22
  • 1
    I just ran a test and I found that `onDestroy()` is **not** called on the running activities when "Clear Data" is used. – ThomasW Jul 22 '16 at 02:49