APK Removal: Last Action Before Uninstalling

I am developing an Android application that installs material on the phoneโ€™s SIM card. I do not want the application to perform the last action when uninstalling: delete everything on the SIM card. This means: I need to take the last action when my APK is removed.

Problem: I did not find a way to do this. (Besides having a secondary application that picks up the intention to remove and does the job, but it is very dangerous because of what Iโ€™m not afraid of)

If anyone has a solution, I'm really interested.

Thanks in advance.

(PS: I'm afraid there really is nobody)

+7
source share
2 answers

You're right. There is no such event, and there is no way to receive a notification when your application is deleted. The application process is simply killed (if it was running), and the application is deleted.

+7
source

If you find that other applications are uninstalled using ACTION_PACKAGE_REMOVED, could you not solve the problem if you made 2 applications? The second is a transmitter that picks up the intent and then deletes the content.

+2
source

All Articles