android - 如何更改下载目录
问题描述
如何将 getrootPatch 目录更改为公共目录。当我使用此目录下载文件时,它正在下载到 Adroid/Data/app.package.com 文件夹..??
我讲这个问题如何使用PRDownloader库来下载文件
public static String getRootDirPath(Context context) {
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
File file = ContextCompat.getExternalFilesDirs(context.getApplicationContext(),
null)[0];
return file.getAbsolutePath();
} else {
return context.getApplicationContext().getFilesDir().getAbsolutePath();
}
}
解决方案
推荐阅读
- macos - 基于 REST 的 Cryptotokenkit 实现
- android - 如何从另一个类 React Native 更改 navigationOptions
- java - 无法压缩位图android studio
- javascript - discord.js-commando if else 循环
- google-app-engine - 将防火墙规则应用于谷歌云中的特定标签不起作用
- c# - 如何根据 WebAPI 中的参数绑定模型
- angular - Angular 4嵌套反应形式手动设置隐藏输入的值
- ios - React-Native - 将应用程序发送到 iPhone 进行测试的最佳方式
- javascript - 在不滚动的情况下将单词换行到下一行
- performance - 提高 Spark ML ALS 的计算性能