[英]java.io.FileNotFoundException: /mnt/sdcard/file (Permission denied)
07-21 05:47:51.572: W/System.err(693): java.io.FileNotFoundException: /mnt/sdcard/file(Permission denied)
My code: 我的代码:
private static final String savedRecords=
Environment.getExternalStorageDirectory().getPath() + "/file";
Log.i(tag, "try enter");
out = new BufferedOutputStream( new FileOutputStream(savedRecords));
Log.i(tag, "write?");
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
over 6000 questions about "java.io.FileNotFoundException", but nothing including "Permission denied" 超过6000个有关“ java.io.FileNotFoundException”的问题,但不包括“权限被拒绝”
why is Permission denied, when is included in AndroidManifest.xml 为什么权限被拒绝(何时包含在AndroidManifest.xml中)
did you use USB for debugging? 您是否使用USB进行调试?
note that when you use USB for debugging, external storage is disabled. 请注意,使用USB进行调试时,将禁用外部存储。
thus,make sure that your device is in "Charge Only" mode. 因此,请确保您的设备处于“仅充电”模式。 not in "Disk Drive" mode. 不在“磁盘驱动器”模式下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.