In my app I have implemented full screening of the image when you click on it. In programm it happens in this way: I pass the bitmap from imageviews(images made by camera) to next activity via put extra, next activity accepts it and shows bitmap in imageview. I have lots of imageviews , and problem is for example If I m making pics in vertical state by camera and if next picture I make in horizontal state, full screen image of previouse images becomes compressed in height.
How I pass the bitmap from 1 activity to next:
Bitmap bitmap = params[0];
int h = bm.getHeight();
int w = bm.getWidth();
bitmap = bitmap.createScaledBitmap(bitmap,w/2,h/2, true);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 50, baos);
byte[] b = baos.toByteArray();
Intent intent = new Intent(PhotoAdder.this, FullScreenImage.class);
intent.putExtra("picture", b);
startActivity(intent);
How next activity accepts bitmap:
Bundle extras = getIntent().getExtras();
byte[] b = extras.getByteArray("picture");
Bitmap bmp = BitmapFactory.decodeByteArray(b, 0, b.length);
ImageView image = (ImageView) findViewById(R.id.full);
image.setImageBitmap(bmp);
The width and height of imageview of next activity is match_parent.