您的位置:首页 > 移动开发 > Android开发

Android在sdcard创建文件失败

2016-10-26 00:00 477 查看
在android6.0或更高版本中创建文件失败,是因为设置里应用的权限没有打开的原因造成的。这个问题困扰了我两天,试了网上的各种办法,从添加权限开始一路排查,都在创建文件失败了。最后在overstack找到了这个答案:

9down vote
I got the same problem,and I am sure I had put the permission tag in the right place,but mkdirs didn't work yet, my system is Android 6.0, I resolve it now , you can check as below:

make sure your put the permission tag in .

open "setting/application" in your phone,check your application's permission(I found the permission in my manifest statement is not here),open the switch of the permission like this.(I found it is closed in default which make "mkdirs" failed)




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息