【问题标题】:Directory not creating in internal storage目录未在内部存储中创建
【发布时间】:2018-08-02 15:16:27
【问题描述】:

我正在尝试使用以下代码将内部存储中的目录创建到 Android 设备中,但似乎我遗漏了一些东西。该目录未显示在内部存储中。我试过这段代码:

File testDir = DirectoryTestActivity.this.getDir("Test", Context.MODE_PRIVATE);
      if (!testDir.exists())
      {
        testDir.mkdirs();
      }

【问题讨论】:

标签: android android-studio


【解决方案1】:

在新文件中添加你的内部路径(你的内部路径)

    File newFolderVideos = new File(context.getFilesDir().getAbsolutePath() + "/Pictures");
   if (!newFolderVideos .exists()) {
    newFolderVideos.mkdirs();
    }

【讨论】:

    猜你喜欢
    • 2016-05-29
    • 2022-08-19
    • 2012-06-08
    • 2017-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-23
    • 1970-01-01
    相关资源
    最近更新 更多