Reputation: 187
When i install my app some folders are created in external storage .At the time of uninstalling the app i need to delete all these folders.
I have tried Broadcast Receiver PACKAGE_REMOVED but it does not work
Upvotes: 0
Views: 946
Reputation: 543
Its not possible to detect when the app is uninstalled. What PACKAGE_REMOVED does is detect when OTHER apps are uninstalled, not your app.
If you want to save files on external directory and these files be removed on uninstall the app, you should use Context.getExternalFilesDir() and the files will be removed automatically (only API 8 or higher)
Upvotes: 1