File cache = getCacheDir();
File appDir = new File(cache.getParent());
Log.d("appDir", String.valueOf(appDir));
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 *******************");
}
}
}
public static boolean deleteDir(File dir) {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
return dir.delete();
}
http://stackoverflow.com/questions/15219011/cache-and-temp-files-folders-remove-android
제 어플들중에 데이터를 청소하는 방법을 구상중인데 구글링을 해본결과 저렇게 하라더군요 근데
로그를 찍어보면 제 앱만 지우고 다른어플들은 지우질 않네요
맨아래는 참고한 주소입니다. 다른어플들의 temp 폴더를 지울수 있는방법이 있나요?