title: Image loading small in size when loaded from URL in Android
body: <p>I have a requirement of loading an Image from a URL in my Android application</p>
  
  <p>For this I created an ImageView in my layout. Following is the Imageview</p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/MyImage"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:gravity="center_horizontal"
      android:layout_gravity="center_horizontal"&gt;          
  &lt;/ImageView&gt;
  </code></pre>
  
  <p>And then in my code I use the following to load the image in this ImageView</p>
  
  <pre><code>ImageView bmImage = (ImageView)this.findViewById(R.id.MyImage);
  String urldisplay = urls[0];
  Bitmap mIcon11 = null;
  try {
      InputStream in = new java.net.URL(urldisplay).openStream();
      mIcon11 = BitmapFactory.decodeStream(in);
  } catch (Exception e) {
      Log.e("Error", e.getMessage());
      e.printStackTrace();
  }
  
  bmImage.setImageBitmap(mIcon11);
  </code></pre>
  
  <p>The image that is lying on my URL path is of size 320 X 50. But very strange, when the image is shown in the ImageView, the size becomes very small, almost half the width and height</p>
  
  <p>I have tried a lot but no solution. Can anybody help please?</p>