안드로이드 폰의 스펙이 다 다르다 보니 

자바 소스에서 onCreate 함수안에서 해당 기계의 폭하고 높이를 측정한다음에

그에 맞게 위젯의 크기를 뿌려주고 싶은데요

Display d = ((WindowManager) getSystemService(WINDOW_SERVICE))
.getDefaultDisplay();

int width = d.getWidth();
int height = d.getHeight();

이렇게 해서 해당 기계의 폭과 높이는 측정했습니다 

그런데 위젯의 크기를 변경하려고 

ImageButton imageButton1 = (ImageButton) findViewById(R.id.bt1);
imageButton1.setAdjustViewBounds(true);
imageButton1.setMaxHeight(height/4);
imageButton1.setMaxWidth(width/4);

이렇게 했더니 아무런 변화가 없고, 

ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(height/4, width/4);
imageButton1.setLayoutParams(params);

이런식으로 했더니 에러가 나네요

제가 완전히 잘못 접근한건지 아니면 다른방법이 있는건지 많은 도움 부탁드립니다.

아참고로 TableLayout 안에 있는 위젯을 변경하려고 합니다.