• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Clean up downloaded data during Uninstalling

dolgong

Lurker
Application stores some data on sd card. I'd like to delete this data when user uninstall my app. Is there anyway to clean up used data on SDCard during uninstallation?

Thanks in advance.
 
It's not possible as your app will never "know" when it's being uninstalled.

Best you can do is either store data internally in your app's "data" storage space, or offer some sort of "cleanup" button inside your app.


Intent | Android Developers

public static final String ACTION_PACKAGE_REMOVED


Broadcast Action: An existing application package has been removed from the device. The data contains the name of the package. The package that is being installed does not receive this Intent.
 
Back
Top Bottom