I have camera app that clicks picture and saves it on sd card
and when I decode that it gives null bitmap here is the code
Bitmap bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+"FacePhoto.jpg");
I have checked in ddms the Facephoto file exists on sd card
what can be problem here that I get “null” bitmap
Try using
Environment.getExternalStorageDirectory()+"/FacePhoto.jpg"use ‘/filename’ instead of just ‘filename’.
If this doesn’t work try using
Environment.getExternalStorageDirectory().getAbsolutePath()+"/FacePhoto.jpg"The point to note is to use absolute path instead of relative.
Also see if filename is correctly spelled in your code.