title: android - fitting image in imageview
body: <p>I'm implementing a widget where i'm trying to display a large image inside an image view (8mpx) like this :</p>
  
  <pre><code> &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical" android:id="@+id/widget"
      android:background="#000000"
      android:padding="15dp"
      android:layout_margin="5dp"
      android:layout_gravity="top|center_vertical|center_horizontal"
  
  
      &gt;
  &lt;LinearLayout android:background="#ffffff" android:padding="1dp" android:layout_width="wrap_content" android:layout_weight="1"
  android:layout_height="wrap_content"  &gt;
       &lt;ImageView 
         android:adjustViewBounds="true"
         android:id="@+id/image"
         android:src="@drawable/sample"
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_weight="1" 
         android:layout_gravity="top|center_horizontal"
         android:scaleType="fitXY"
         android:maxWidth="200dip"
         android:maxHeight="300dip"
         /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the emulator everything seems ok, but when i deploy to device, i get the "problem loading widget" message.
  the emulator is HVGA and my device has a 480x800 resolution.
  Any ideea what am i doing wrong ?</p>
  
  <p>Thank you!</p>
  
  <p>==================================================</p>
  
  <p>As advised by you guys i've made a screenshot of the logcat.
  Here it is :</p>
  
  <p><img src="https://i.stack.imgur.com/s7KEV.png" alt="enter image description here"></p>