Make directory in android

后端 未结 8 660
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 17:40

Im trying to build a directory called \"images\" on the SD card on android. This is my code but its not working? Can anyone give me some advice?

File picDire         


        
8条回答
  •  囚心锁ツ
    2020-12-13 18:27

    Environment.getExternalStorageDirectory() is deprecated. So you should use you this:

    File directory = new File(this.getExternalFilesDir(null).getAbsolutePath() + "/YourDirectoryName");
    directory.mkdirs();
    

提交回复
热议问题