Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Button bt1 = new Button(this);
- bt1.setText("1");
- Button bt2 = new Button(this);
- bt2.setText("2");
- Button bt3 = new Button(this);
- bt3.setText("3");
- Button bt4 = new Button(this);
- bt4.setText("4");
- Button bt5 = new Button(this);
- bt5.setText("5");
- Button bt6 = new Button(this);
- bt6.setText("6");
- Button bt7 = new Button(this);
- bt7.setText("7");
- Button bt8 = new Button(this);
- bt8.setText("8");
- Button bt9 = new Button(this);
- bt9.setText("9");
- Button bt0 = new Button(this);
- bt0.setText("0");
- //bt0.setLayoutParams(params);
- // GridLayout gl = new GridLayout(this);
- // gl.setOrientation(GridLayout.VERTICAL);
- GridLayout gl = new GridLayout(this);
- gl.setOrientation(GridLayout.HORIZONTAL);
- gl.setColumnCount(3);
- gl.setRowCount(4);
- gl.addView(bt1);
- gl.addView(bt2);
- gl.addView(bt3);
- gl.addView(bt4);
- gl.addView(bt5);
- gl.addView(bt6);
- gl.addView(bt7);
- gl.addView(bt8);
- gl.addView(bt9);
- gl.addView(bt0);
- setContentView(gl);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement