title: how to resize image to match parent in android
body: <p>I have a ImageView with width as MatchParent and height as 200DP. I want the image to fill this image view regardless the actual size of image, Anyhow. I tried a bit line of code:</p>
  
  <pre><code>Display dis= getWindowManager().getDefaultDisplay();
  int dpi=getResources().getDisplayMetrics().densityDpi;
  int height=200*dpi/160
  
  if(profileOrCover.equalsIgnoreCase("cover"))
      img.setImageBitmap(Bitmap.createScaledBitmap(image, dis.getWidth()*dpi/160, height, false));
  </code></pre>
  
  <p>I Need help.!!</p>