hello i\'m trying to save pictures taken on my application, but when i try to access the memory to place the data, an error comes out
unable to decode stream java.io
First, you are writing the image to a different location than you are reading it from. Rather than rebuild path
, use the tmpFile
value that you already have.
Second, do not use getRootDirectory()
to get the DCIM
directory. Use getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
.
Third, use Log
methods to log exceptions, rather than just display a Toast
, as you may miss the Toast
and you do not get the stack trace associated with your exception.