title: ImageView set image
body: <p>I use two ways to set image for imageView, by xml and by code <code>setBackgroundResource</code></p>
  
  <p>eg. <code>img.setBackgroundResource(R.drawable.task_learn_lock);</code></p>
  
  <p>OR xml</p>
  
  <pre><code>&lt;ImageView
          android:id="@+id/img"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal|center_vertical"
          android:layout_weight="1"
          android:src="@drawable/task_learn_lock"
          android:contentDescription="@string/desc"
          android:scaleType="centerInside" /&gt;
  </code></pre>
  
  <p>But the result is different, the image created by code is streched vertically.  Anyone know why?  I need to set a new image when the app is running. I tried to post a screen shot, but i do not have enough reputation to do so. Thanks.</p>