我是先獲取了系統圖庫裡的某個圖片的路徑 path,然後
File file = new File(path);
InputStream is = new FileInputStream(file);
然後就報錯W/System.err: java.io.FileNotFoundException: /storage/emulated/0/Tencent/QQ_Images/null-52a51a941f2792db.jpg: open failed: EACCES (Permission denied)
W/System.err: at libcore.io.IoBridge.open(IoBridge.java:459)
W/System.err: at java.io.FileInputStream.(FileInputStream.java:76)
W/System.err: at com.fc.net.UploadUtil.uploadFile(UploadUtil.java:72)
W/System.err: at com.fc.ui.activity.club.CreateClubActivity$3.run(CreateClubActivity.java:149)
W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
W/System.err: at libcore.io.Posix.open(Native Method)
W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
W/System.err: at libcore.io.IoBridge.open(IoBridge.java:445)
W/System.err: ... 3 more
你的tagetsdk大於等於23嗎?如果是的話,需要動態申請權限,在manifest裡申請是不行的