title: Change button size programmatically
body: <p>I already checked existing thread for a solution. The answer was always:</p>
  
  <p>setLayoutParams(new LayoutParams(100, 100)</p>
  
  <p>So I tried, but as I push the button my application crashes:</p>
  
  <pre><code>public class MainActivity extends Activity {
      Button btn;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      btn = (Button) findViewById(R.id.button1);
      btn.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              btn.setLayoutParams(new LayoutParams(100, 100));
          }
      });
  }
  }
  </code></pre>
  
  <p>What am I doing wrong ? Thanks !</p>