is there any way, when uninstalling application, that I also remove some data, which was used by that application? I mean some sort of onUninstall method?
Thanks
is there any way, when uninstalling application, that I also remove some data, which was used by that application? I mean some sort of onUninstall method?
Thanks
Sorry, Android (as of now) does NOT have any method like onUninstall
. So there's no way you can run any code while uninstalling. Have a look at this thread for more information.
However, you can use createExternalStoragePrivateFile
and getExternalFilesDir
methods to create an external file. Which will be deleted when your app is uninstalled.
Take a look at docs and sample code from Android dev site.
That kind of data you have to store in /data/data/ so that when the application is uninstalled the data of your app also removed. Your can use Activity.getDir() to get that folder.
No,That will always remove data which stored in APK.
if you will store in sd card then it may be possible that you can get back but developer can also remove that data from any other location for security reason.
some time developer did not remove form sd card . so that you can get back and reuse again by your coding.
so,now its depends on you that where you are storing your data and how you will use them.