04-19 14:38:08.868: W/ContextImpl(17290): Failed to ensure directory: /storage/sdcard1/Android/data/xxxx/files/xxx-cache
在android4.0源码出来以后,关于sd卡问题似乎没有解决好,起码上层api中没有体现到位。其实在framework层中有相应的类去获得内外置sd卡信息,是否可读写的权限。
在2.x的版本中,在manifest中配置的权限android.permission.WRITE_EXTERNAL_STORAGE确实是用来使得sd卡获得写的权限。而在4.0开发的源码当中,由于有了内外置sd卡的区分,android.permission.WRITE_EXTERNAL_STORAGE的权限用来设置了内置sd卡的写权限,如果在manifest中只是配置了这个权限,那个应用只能在内置sd卡中进行写操作,还是无法在外置sd卡中进行写操作。需要写外置sd卡的话,需要配置另一个权限android.permission.WRITE_MEDIA_STORAGE,这样就可以在外置sd卡中进行写入操作了。
这两个权限都被定义在android源码目录\frameworks\base\data\etc\platform.xml中:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
</permission>
<permission name="android.permission.WRITE_MEDIA_STORAGE" >
<group gid="media_rw" />
</permission>
分享到:
相关推荐
vsftp出现550 Failed to change directory Ubuntu 获取软件失败 404错误 解决Ubuntu提示500 OOPS: vsftpd: refusing to run with writable root inside chroot()
mr任务报Failed to create directory错误、硬盘故障定位方法
vbsedit Failed to load pdm.dll解决办法. 带有详细的使用说明 安装 vbsedit 运行时 来提示vbsedit Failed to load pdm.dll 千辛万苦找到的 很好用的解决办法
Failed to access IIS metabase. 问题解决Failed to access IIS metabase. 问题解决Failed to access IIS metabase. 问题解决Failed to access IIS metabase. 问题解决
server failed to respond。
win2000开机出现报错error failed to load kernel library,win2000开机出现报错error failed to load kernel library
pyzbar库生成EXE,PyInstallerImportError: Failed to load dynlib/dll问题解决方法附源码
JAVAHttpClientThe server failed to respond with a validCaused by: org.apache.htt
用u盘启动模式下安装 Ubuntu16.04及以上,出现安装问题。ubuntu彻底解决-“Failed to load ldlinux.c32”问题
failed to execute script 解决方案+命令行执行传参exe
解决kali Linux 报错Failed to start network manager的补丁,具体修复过程参考我的博客
亲测解决tomcat9.08搭配jkd9,搭建servlet环境。常见问题是,The required Server component failed to start so Tomcat is unable to start。这个问题,直接通过配置eclipse来解决这个问题。
当更新SVN时,出现Failed to run the WC DB work queue
解决log4j:ERROR Failed to rename, win系统占用文件无法改名字的问题
XP系统在回放LoadRunner11录制脚本时提示“Vuser failed to initialize extension LrXml.dll”的解决方法
log4j:ERROR Failed to rename错误; 网上查找了下原因,大概意思是日志文件始终被占有,所以当log4j对日志文件进行rename时,就发生了Failed to rename错误 。要修改log4j的源码,附件是我修改好后的,方便大家...
1.Connect to the ESX host using SSH. For more information, see Connecting to an ESX host using an SSH client (1019852). 2.Take a backup of the /etc/vmware/config file using this command: cp /etc/...
关于mac上运行kinect后出现Target VM failed to initialize的解决办法
Failed to prettify component 。。screenMap.vue template sou
Failed to map the path