Manually I can do
Settings -> Applications -> Manage applications -> (choose my app) -> Clear data
How do I do this programmatically?
I need to delete all data, including those in shared preferences (, and variables).
Manually I can do
Settings -> Applications -> Manage applications -> (choose my app) -> Clear data
How do I do this programmatically?
I need to delete all data, including those in shared preferences (, and variables).
Everything in your application is stored here /data/data/com.example.applicationpackagename/
.
Your application is run by a user which has R/W access on this directory.
You just need to remove every files in it.
For information : Android - How to delete a whole folder and content?
You could use following code in which "packagename" could be your application package name like com.example.app1
Intent intent = new Intent();
intent.setData(Uri.parse("package:" + packageName));