android 内部共享存储,Android共享内部存储
生活随笔
收集整理的這篇文章主要介紹了
android 内部共享存储,Android共享内部存储
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
我現在面對txt文件的類似情況,并做到了這一點.
File downloadedFile= new File( context.getFilesDir(),"simple.txt" );
downloadedFile.setReadable( true,false );
downloadedFile.setWritable( true,false ); //set read/write for others
Uri downloadFileUri = Uri.fromFile( downloadedFile );
Intent intentToEditFile = new Intent( Intent.ACTION_EDIT );
intentToEditFile.setDataAndType( downloadFileUri,"text/plain" );
context.startActivity( intentToEditFile );
現在將啟動’Document 2 Go’編輯器來編輯文件和
將能夠編輯simple.txt
注1:應該使用設置的相同文件對象創建UrisetReadable()/ setWritable.注2:其他用戶的讀/寫權限可能不會反映在文件中系統.有時我在adb shell中看不到rw-rw-rw-
總結
以上是生活随笔為你收集整理的android 内部共享存储,Android共享内部存储的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2021年全球及中国企业级路由器市场竞争
- 下一篇: ondestroy什么时候调用_尾调用和