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
<application android:managespaceactivity= ". Activity. Settingactivity "></application>
Let's look at the Android app information interface
This time to clear the Data button programming management Space , after clicking, start the specified activity, I only allow to delete the cache file and clear the database in the collection table
Android:managespaceactivity Let apps manually manage your app's data Catalog