I open the application for the camera with the click of a button. And displaying the captured photo in the next step. But the captured photo rotates 90 degrees. When I display an image in a view after it is captured, its orientation is always landscape. Why is the photograph not displayed in the portrait, as when photographing in portrait mode?
onPress the button:
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(APP_DIR+"/latest.png"))); startActivityForResult(i, CAPTURE_PHOTO_CONSTANT);
Inside onActvityresult:
bmp = BitmapFactory.decodeFile(APP_DIR+"/latest.png"); startActivity(new Intent(this, DisplayActivity.class));
Display taken photo:
photoViewRelativeLayout.setBackgroundDrawable(new BitmapDrawable(getResources(), CaptureActivity.bmp));
android bitmap camera
Santhosh
source share