android java.io.IOException: Parent directory of file is not writable: /sdcard/

做Android一年多了!今天在北京总公司带几个新人入门!

这一周上了五天的课!又当了一把老师!

讲课的内容大概是:Android系统架构

Activity生命周期Intent的验证流程

UI布局

SQLiteContentProvider

BroadCast与Notification

Service与aidl

今天居然碰见一个Sdcard的读取问题搞了十几分钟纠结!在此做下纪录!

androidjava.io.IOException:Parentdirectoryoffileisnotwritable:/sdcard/

找到和WRITE相关的permission有以下几个:

WRITE_CALENDAR"android.permission.WRITE_CALENDAR"

WRITE_CONTACTS"android.permission.WRITE_CONTACTS"

WRITE_OWNER_DATA"android.permission.WRITE_OWNER_DATA"

WRITE_SETTINGS"android.permission.WRITE_SETTINGS"

WRITE_SMS"android.permission.WRITE_SMS"

WRITE_SYNC_SETTINGS"android.permission.WRITE_SYNC_SETTINGS"

试过了都不行,

后来一看,还有个权限我没看到,那就是WRITE_EXTERNAL_STORAGE。这次好用了。

<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

相关推荐