I use the following snippet(from SO post here) to display photo taken using camera as a thumbnail, in an imagevew. But the thumbnail of the picture does not show up and remain blank. What can be the reason?
Bundle extras = data.getExtras();
if(extras.get("data") != null){
Bitmap imageBitmap = (Bitmap) extras.get("data");
// Get the dimensions of the View
int targetW = imgViewPreview.getWidth();
int targetH = imgViewPreview.getHeight();
// Get the dimensions of the bitmap
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
bmOptions.inJustDecodeBounds = true;
Bitmap bitmap = Bitmap.createScaledBitmap(picture, targetW, targetH, true);
imgViewPreview.setVisibility(View.VISIBLE);
imgViewPreview.setImageBitmap(imageBitmap);
}