I am getting pictures from the sdcard in my app. I am using imageview to display image. However since I dont know if the image will be horizontal or vertical, how can I show horizontal or vertical image in imageview appropriately.Thanks
File img_file = new File(picture_path);
bm = BitmapFactory.decodeFile(img_file.getAbsolutePath());
iv2.setImageBitmap(bm);
imageview xml
<ImageView
android:id="@+id/iv_image2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:scaleType="fitXY"
android:adjustViewBounds="true"
/>