How to create a directory in External SD in android application

前端 未结 4 763
暖寄归人
暖寄归人 2021-01-25 09:39

I want to create a directory on \"/mnt/extsd/MyFolder\" this path. while calling mkdir() it returns false.I inserted the sdcard on my tablet, got the external path as \"/mnt/ext

4条回答
  •  走了就别回头了
    2021-01-25 09:56

    final String PATH = Environment.getExternalStorageDirectory() + "/myfolder/";
    
    if(!(new File(PATH)).exists()) 
    new File(PATH).mkdirs();
    

    include permission in manifest::

     
    

提交回复
热议问题