android.content.Context.getNoBackupFilesDir()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(220)

本文整理了Java中android.content.Context.getNoBackupFilesDir()方法的一些代码示例,展示了Context.getNoBackupFilesDir()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getNoBackupFilesDir()方法的具体详情如下:
包路径:android.content.Context
类名称:Context
方法名:getNoBackupFilesDir

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());
      }
    });
  }
}

相关文章

Context类方法