nakka soft world !

Multi CheckBox 본문

프로그래밍언어/안드로이드(Android)

Multi CheckBox

nakka 2014. 3. 10. 22:32
728x90

public class TypeChoice extends Activity implements OnCheckedChangeListener{

CheckBox[] cbList;

cbList = new CheckBox[]{
             (CheckBox)findViewById(R.id.ckboxIndian),
               (CheckBox)findViewById(R.id.ckboxMedieval),
               (CheckBox)findViewById(R.id.ckboxJapan),
               (CheckBox)findViewById(R.id.ckboxAztec),
   };

for(int i=0; i<cbList.length; i++)
{
        cbList[i].setOnCheckedChangeListener(this);
}

public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
     switch(buttonView.getId())
     {
           case R.id.ckboxIndian:
           {
                 if (isChecked) {
                 } else {
                 }
                 break;
           }
     }
}

728x90
Comments