一直获取不到写的权限,只有读的权限。
代码如下:
File f=new File(homedir,file);
f.setExecutable(true, false);
f.setReadable(true, false);
f.setWritable(true, false);
if(f.canWrite())
Log.i("rrrrrrr","file can write");
else
Log.i("rrrrrrr","file cannot write");
f.delete();
this.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(f)));
设备为Android 5.1.1电视,用es文件浏览器可以删除U盘文件,但是需要确认对话框,现尚无法查明该机制
Google은 Android 4.4부터 SD 카드의 콘텐츠를 읽고 쓰는 데 사용할 수 있는 저장소 액세스 프레임워크인 SAF(Storage Access Framework)라는 새로운 API 세트를 도입했습니다.
첨부파일:
stackoverflo 관련 토론 스레드