I take a picture with the camera using
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
startActivityForResult( intent, 22 );
<
Why not this way:
ImageView MyImageView = (ImageView)findViewById(R.id.imageView1);
Drawable d = Drawable.createFromPath( PATH TO FILE );
MyImageView.setImageDrawable(d);
bitmap = BitmapFactory.decodeFile(imageInSD);
iv.setImageURI(Uri.fromFile(in));
Try BitmapFactory.decodeFile()
and then setImageBitmap()
on the ImageView
.
Also possible:
java.io.FileInputStream in = openFileInput("myfile.png");
iv.setImageBitmap(BitmapFactory.decodeStream(in));
There should be no difference between decodeStream()
and decodeFile()
. decodeFile()
method opens an inputstream and calls decodeStream()
. This was already answered at this link