
<uses-permission androID:name="androID.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission androID:name="androID.permission.MOUNT_UNMOUNT_fileSYstemS" />.
因为在我的应用程序中使用forceStopPackage,我需要将androID.uID.system添加到清单中.我在make文件中写了LOCAL_CERTIFICATE:= platform.谁能解释这个奇怪的问题.设置androID.uID.system后,我的应用程序属于系统进程,应该有更多的权限访问SD卡.这是我的想法.以下是我的代码:
public voID setPackage(String dir){ System.out.println( "setPackage dir=="+dir ); file share=new file("/mnt/sdcard","test.txt"); if(!share.exists()){ try{ share.createNewfile(); }catch(Exception e){ System.out.println( "creat file happen exception--->" +e.toString() ); } } try{ if(share!=null){ System.out.println( "create file is not null" ); fileOutputStream fops=new fileOutputStream(share); fops.write(dir.getBytes()); fops.flush(); fops.close(); } }catch(Exception e){ System.out.println( "write Exception-->" +e.toString() ); } } 我的应用程序在模拟器上运行,目标版本为2.3.非常感谢你.
解决方法 请阅读: link1这个link2
总结以上是内存溢出为你收集整理的在我的应用程序中设置“android.uid.system”后,它无法访问SD卡?全部内容,希望文章能够帮你解决在我的应用程序中设置“android.uid.system”后,它无法访问SD卡?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)