开发者

java.io.FileNotFoundException: /sdcard/DCIM/ROBIN.jpg (No such file or directory)

I'm getting an error on the following line of co开发者_运维百科de:

FileInputStream is = new FileInputStream("/sdcard/DCIM/ROBIN.jpg");

The error is:

java.io.FileNotFoundException: /sdcard/DCIM/ROBIN.jpg (No such file or directory)

But the image is present in the directory

My USB connection is Charge only


Never hardcode paths like /sdcard. For example, /sdcard is wrong on most Android devices. Use Environment.getExternalStorageDirectory() to find the root of external storage.


Make sure you have set the permission WRITE_EXTERNAL_STORAGE in your manifest.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜