Hi, I wanted to modify the image of my ImageView using the path that I saved in my SQLite database. Well, what I want to achieve is that it starts in a second whenever an image is available, it will be displayed and remain until the next image appears. But it will use the default image when not showing anything at all. But at the moment, the main problem that I wanted to solve is that I can not install imageView using the path that I have. I tried different solutions, such as creating a bitmap from a path, but still getting the same error as: E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /mnt/sdcard/Echo/Images/Awesome4 - 00:01.jpg: open failed: ENOENT (No such file or directory)
Here is my code for now:
String path = db.getImagePath(file_name, curTime); Log.v("Your image filename", file_name); Log.v("Your currentPosition", curTime); Log.v("Your Path Playback edit", path); try{ preview.setImageURI(Uri.parse(Environment.getExternalStorageDirectory()+"/Echo/Images/"+file_name)); }catch (Exception e){ e.printStackTrace(); preview.setImageResource(R.drawable.sample_image); }
This is managed. and here logcat I get:
V/Your Path: /mnt/sdcard/Echo/Images/ V/Your image filename: Awesome4 - 00:01.jpg V/Your currentPosition: 00:01 V/Your Path Playback edit: /mnt/sdcard/Echo/Images/ E/BitmapFactory: Unable to decode stream: java.io.FileNotFoundException: /mnt/sdcard/Echo/Images/Awesome4 - 00:01.jpg: open failed: ENOENT (No such file or directory) I/System.out: resolveUri failed on bad bitmap uri: /mnt/sdcard/Echo/Images/Awesome4 - 00:01.jpg D/dalvikvm: GC_CONCURRENT freed 380K, 14% free 3067K/3560K, paused 74ms+3ms, total 226ms V/Your image filename: Awesome4 - 00:02.jpg V/Your currentPosition: 00:02 V/Your Path Playback edit: [ 06-27 04:14:07.691 6043: 6043 E/BitmapFactory ] /mnt/sdcard/Echo/Images/Awesome4 - 00:02.jpg: open failed: ENOENT (No such file or directory)
source share