I have this code to preview an image loaded from the phone, the problem is when I use camera to take image and load it to my app it gets rotated 90 degrees. What could be causing this behavior? This is my code:
private void addImageToGrid(String selectedImageUri) {
Bitmap bitmap = getBitmapFromPath(selectedImageUri);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 8;
int bitmapWidth = 90;//bitmap.getScaledWidth(density);
int bitmapHeight = 80;// bitmap.getScaledWidth(density);
ImageItem imageItem = new ImageItem();
imageItem.setImage(Bitmap.createScaledBitmap(bitmap, bitmapWidth, bitmapHeight, false));
imageItem.setUri(selectedImageUri);
gridViewAdapter.add(imageItem);
}