@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_go_get_me_gallery_select); btnBack = (Button) findViewById(R.id.Back); btnBack.setMaxHeight(150); btnBack.setMaxWidth(200); btnBack.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent openEditCat = new Intent(getApplicationContext(), GoGetMeAddLocation.class); startActivity(openEditCat); } }); btnGallery = (Button) findViewById(R.id.Gallery); btnGallery.setMaxHeight(150); btnGallery.setMaxWidth(200); btnGallery.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent openEditCat = new Intent(GoGetMeSelectImage.this, GoGetMeSelectThumb.class); startActivity(openEditCat); } }); btnSDcard = (Button) findViewById(R.id.Camera); btnSDcard.setMaxHeight(150); btnSDcard.setMaxWidth(200); btnSDcard.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Intent openEditCat = new Intent(GoGetMeSelectImage.this, GoGetMeCameraView.class); startActivity(openEditCat); } }); }
private void lockButtonSizes(int NUM_ROWS, int NUM_COLS) { for (int row = 0; row != NUM_ROWS; row++) { for (int col = 0; col != NUM_COLS; col++) { Button button = buttons[row][col]; int width = button.getWidth(); button.setMinWidth(width); button.setMaxWidth(width); int height = button.getHeight(); button.setMinHeight(height); button.setMaxHeight(height); } } }