Today the Android encounters a requirement that does not allow the user to completely clear the app Private directory (/data/data/package name/), but Android by default the user clicks the erase data in the app information The button completely clears all the data files in the application's private directory, including Sharedpreference, cache files, databases, and other important data.
If we don't want users to do this, we need to use The android:managespaceactivity property, which is a property of the application tag in Androidmanifest.xml, is used to designate an activity to manage the data
, plus this attribute, specifies that settingactivity is the activity that manages the space
XML code
- <application
- android:managespaceactivity=". Activity. Settingactivity " >
- </Application>
Let's look at the Android app information interface
This time the clear Data button becomes the administrative space , after clicking, launches the specified activity, I only allow to delete the cache file and clears the collection table in the database
Mobile development Android:managespaceactivity lets apps manually manage your app's data Catalog