Perform a task on uninstall in android

dhaiwat picture dhaiwat · Jun 10, 2010 · Viewed 26.2k times · Source

I have developed an Android app. Now I want to perform a few operations (i. e. - Reset the settings etc.. ) at the moment the app gets uninstalled from the phone.

Is it possible to reigster a listener or a function that is called at the moment the app is removed?

Answer

Janusz picture Janusz · Jun 10, 2010

Sadly android at the moment does not give you a possibility to perform code at the moment your app is uninstalled.

All the settings that are set via the SharedPreferences are deleted together with everything in the Application Data an Cache folder.

The only thing that will persist is the data that is written to the SD-Card and any changes to phone settings that are made. I don't know what happens to data that is synchronized to the contacts through your app.