本文整理了Java中android.content.Context.getNoBackupFilesDir()
方法的一些代码示例,展示了Context.getNoBackupFilesDir()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getNoBackupFilesDir()
方法的具体详情如下:
包路径:android.content.Context
类名称:Context
方法名:getNoBackupFilesDir
暂无
代码示例来源:origin: oasisfeng/condom
@RequiresApi(LOLLIPOP) @Override public File getNoBackupFilesDir() {
return mBase.getNoBackupFilesDir();
}
代码示例来源:origin: ACRA/acra
@NonNull
@Override
public File getFile(@NonNull Context context, @NonNull String fileName) {
File dir;
if (Build.VERSION.SDK_INT >= 21) {
dir = context.getNoBackupFilesDir();
} else {
dir = new File(context.getApplicationInfo().dataDir, "no_backup");
}
return new File(dir, fileName);
}
},
代码示例来源:origin: Trumeet/MiPushFramework
@RequiresApi(LOLLIPOP) @Override public File getNoBackupFilesDir() {
return mBase.getNoBackupFilesDir();
}
代码示例来源:origin: CaMnter/AndroidLife
public static File getNoBackupFilesDir(Context context) {
return context.getNoBackupFilesDir();
}
代码示例来源:origin: kingargyle/adt-leanback-support
public static File getNoBackupFilesDir(Context context) {
return context.getNoBackupFilesDir();
}
代码示例来源:origin: sorz/TinyKeePass
static public File getDatabaseFile(Context context) {
return new File(context.getNoBackupFilesDir(), FetchDatabaseTask.DB_FILENAME);
}
代码示例来源:origin: sorz/TinyKeePass
public FetchDatabaseTask(Context context, Uri uri, String masterPwd,
String username, String password) {
this.context = new WeakReference<>(context);
this.uri = uri;
masterPassword = masterPwd;
cacheDir = context.getCacheDir();
filesDir = context.getNoBackupFilesDir();
if (uri.getScheme().startsWith("http") && username != null && password != null) {
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
if (!getRequestingURL().getAuthority()
.equals(FetchDatabaseTask.this.uri.getAuthority()))
return null;
return new PasswordAuthentication(username, password.toCharArray());
}
});
}
}
内容来源于网络,如有侵权,请联系作者删除!