title: How to programmatically change layout_width and layout_height of image?
body: <pre><code>public void repeatSong(View view)
  {
      if (repeatFlag) //If repeatFlag (Repeat Function) is activated
      {
          //onClick, icon change to dactivated state
          btnRepeat.setBackgroundResource(R.drawable.repeatwhiteicon);
          btnRepeat.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
          btnRepeat.setMinimumHeight(70);
          btnRepeat.setMinimumWidth(70);
      }
  
      else //If repeatFlag (Repeat Function) is deactivated
      {
          //onClick, icon change to activated state
          btnRepeat.setBackgroundResource(R.drawable.repeatblueicon);
          btnRepeat.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
      }
  
          // onClick, repeatSong function is inverted (Activated-Deactivated OR Deactivated-Activated)
          repeatFlag = !repeatFlag;
  
  }
  </code></pre>
  <p>btnRepeat is a ImageButton, it is a ImageButton when clicked, is supposed to changed to another image. However, I do not know how to change the <code>layout_width</code> and <code>layout_height</code> of the image. I managed to figure out how to change the scale type of the image.  <code>btnRepeat.setMinimumHeight(70);</code> and <code>btnRepeat.setMinimumWidth(70);</code> did not work in my case.</p>
  <p>How do I change it then? Thank you in advance.</p>