【问题标题】:How to get a specific path on the SD card?如何获取 SD 卡上的特定路径?
【发布时间】:2018-07-29 00:20:11
【问题描述】:

我想访问安装了我的应用程序的文件夹以及它的数据、缓存等。我该怎么做?我目前正在使用它,但这仅指定了 SD 卡上的路径。

   File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
File FileDirectory = new File(dir, "winrar-x64-560.exenb");

【问题讨论】:

标签: android


【解决方案1】:

您可以通过这种方式访问​​:

File file = getExternalFilesDir(null);

或者,试试这个

File file = new File(Environment.getExternalStorageDirectory()+"/Android/data/"+getPackageName());

问候。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多