Button yourBtn = (Button) findViewById.(R.id.yourBtn); int btnSize=yourBtn.getLayoutParams().width; yourBtn.setLayoutParams(new LayoutParams(btnSize,btnSize));