ImageView with matrix, on initialization
<p>I have a problem with a scale of one image on imageview. The imageview has scaletype matrix. And I have a custom Touchlistener who let me make zoom and drag&amp;drop, etc.. But when I setimage on imageview, this appears zoomed. </p>

<p>I try solve it, searching many solutions on this web and others. But the last is:</p>

<pre><code>ImageView iv = (ImageView) findViewById(R.id.imageView);
iv.setImageResource(R.drawable.test_image);

Matrix mMatrix = iv.getImageMatrix(); mMatrix.setRectToRect(new
  RectF(0, 0, iv.getMeasuredWidth(), iv.getMeasuredHeight()),new
  RectF(0, 0, iv.getMeasuredWidth(), iv.getMeasuredHeight()),
        Matrix.ScaleToFit.CENTER);
</code></pre>

<p>and the xml is:</p>

<pre><code>&lt;RelativeLayout...&gt;
.....
    &lt;FrameLayout
        android:id="@+id/root"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/buttonlayer"&gt;

        &lt;ImageView
            android:id="@+id/imageView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:adjustViewBounds="true"
            android:scaleType="matrix"
            android:contentDescription="@string/desc"
            /&gt;
    &lt;/FrameLayout&gt;

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

<p>But I can't solve it!, the  imageview continues showing wrong!</p>

<p>Thanks in advance!</p>
