本文整理了Java中android.content.Context.getExternalCacheDirs()
方法的一些代码示例,展示了Context.getExternalCacheDirs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getExternalCacheDirs()
方法的具体详情如下:
包路径:android.content.Context
类名称:Context
方法名:getExternalCacheDirs
暂无
代码示例来源:origin: oasisfeng/condom
@RequiresApi(KITKAT) @Override public File[] getExternalCacheDirs() {
return mBase.getExternalCacheDirs();
}
代码示例来源:origin: Trumeet/MiPushFramework
@RequiresApi(KITKAT) @Override public File[] getExternalCacheDirs() {
return mBase.getExternalCacheDirs();
}
代码示例来源:origin: goeasyway/EasyPlug
@Override
public File[] getExternalCacheDirs() {
return hostContext.getExternalCacheDirs();
}
}
代码示例来源:origin: goeasyway/EasyPlug
@Override
public File[] getExternalCacheDirs() {
return hostContext.getExternalCacheDirs();
}
代码示例来源:origin: kingargyle/adt-leanback-support
public static File[] getExternalCacheDirs(Context context) {
return context.getExternalCacheDirs();
}
代码示例来源:origin: stackoverflow.com
PackageManager pm = getPackageManager();
List<ApplicationInfo> installedApplications = pm.getInstalledApplications(0);
for (ApplicationInfo applicationInfo : installedApplications) {
try {
Context packageContext = createPackageContext(applicationInfo.packageName, 0);
List<File> directories = new ArrayList<>();
directories.add(packageContext.getCacheDir());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Collections.addAll(directories, packageContext.getExternalCacheDirs());
} else {
directories.add(packageContext.getExternalCacheDir());
}
StringBuilder command = new StringBuilder("rm -rf");
for (File directory : directories) {
command.append(" \"" + directory.getAbsolutePath() + "\"");
}
Shell.SU.run(command.toString());
} catch (PackageManager.NameNotFoundException wtf) {
}
}
内容来源于网络,如有侵权,请联系作者删除!