Payday Loan Payday Loan

Hi,
Below i will show you a method to delete all cache saved by your app. You will clear shared preferences, files and folders from data/data/ folder, databases, and all you got in cache.
This is the method:

public void clearApplicationData()
	{
		File cache = getCacheDir();
		File appDir = new File(cache.getParent());
		if (appDir.exists())
		{
			String[] children = appDir.list();
			for (String s : children)
			{
				if (!s.equals("lib"))
				{
					deleteDir(new File(appDir, s));
					Log.i("TAG", "File /data/data/APP_PACKAGE/" + s + " DELETED ");
				}
			}
		}
	}
||||| 0 I Like It! |||||

Search

Popular

Sponsors