Unable To Decode Stream: Java.io.filenotfoundexception:
I have an app that takes pictures. I have recently had to change part of said app due to no longer being able pass URIs in intents. So I changed part of my code from file_uri = Uri
Solution 1:
bitmap = BitmapFactory.decodeFile(file_uri.getPath());
change to
bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(file_uri));
But of course it is not good to make a Bitmap out of the file first.
You should of course upload the file 'as is' without messing around with Bitmaps and BitmapFactory.
Solution 2:
try using BitmapFactory.decodeStream
rather than BitmapFactory.decodeFile
.
Here is an example of how to use it.
Post a Comment for "Unable To Decode Stream: Java.io.filenotfoundexception:"