android4.4 两个sdcard一个可以访问,另一个报无权限

I/System.out( 922): mkdir failed: EACCES (Permission denied) path = /storage/sdcard1/com.ayst.healthkit

阅读 6.4k
1 个回答

Android 4.4 取消了非内置应用的第二个及以上外置存储器的写权限,但是这个存储器有个目录除外.../Android/data/data/packe-name/

附上官方解释:
http://developer.android.com/intl/zh-cn/guide/topics/data/data-storage.html#filesExternal

Note: Beginning with Android 4.4, these permissions are not required if you're reading or writing only files that are private to your app. For more information, see the section below about saving files that are app-private.

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题