Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TableLayout l = (TableLayout) findViewById(ID_OF_YOUR_LAYOUT);
- CheckBox box = new CheckBox(this);
- box.setChecked(true);
- box.setOnCheckedChangeListener(new OnCheckedChangeListener(){
- public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
- //what happens when the it's unchecked or checked
- }
- });
- l.addView(box);
- RelativeLayout.LayoutParams layout =
- new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, 200);
- l.addView(box,layout);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement