ImageView Not Shown After Rotation In Android
<p>Actually I programming a app that use image rotation. But when I rotate image, it doesn't show anything.</p>

<p>This is my code:</p>

<p>XML file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;

&lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rotate_test_layout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" &gt;

    &lt;ImageView
        android:id="@+id/android"
        android:src="@drawable/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:scaleType="matrix"
        android:adjustViewBounds="true"
        android:contentDescription="@string/android_description" &gt;
    &lt;/ImageView&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>Activity file:</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.rotate_test_layout);
    ImageView imageView = (ImageView)findViewById(R.id.android);
    imageView.setScaleType(ScaleType.MATRIX);
    Matrix matrix = new Matrix();
    matrix.postRotate(90);
    imageView.setImageMatrix(matrix);
}
</code></pre>
