jeudi 5 novembre 2015

How to set only on checkBox clicked in android?

I am building an android application where I am creating multiple checkBox in linear layout. Below is my code

//Make multi leg info display to user
    for(int i = 0; i < PickerForm.GoogleAddress.size(); i++) {
        LayoutInflater inflater = null;
        inflater = (LayoutInflater) getApplicationContext()
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View mLinearView = inflater.inflate(R.layout.custome_leg_detail, null);
        TextView legName = (TextView) mLinearView.findViewById(R.id.legName);
        TextView legPhone = (TextView) mLinearView.findViewById(R.id.legPhoneNumber);
        TextView legAddress = (TextView) mLinearView.findViewById(R.id.legAddress);
        TextView legCashToPick = (TextView) mLinearView.findViewById(R.id.legCashToPick);
        final CheckBox radioButtonCashToCollect = (CheckBox) mLinearView.findViewById(R.id.radioButtonCashToCollect);
        radioButtonCashToCollect.setTag(String.valueOf(i));        
           legLinearLayout.addView(mLinearView);
        }

I want there should be only one checkBox clicked at a time.




Aucun commentaire:

Enregistrer un commentaire