update Checkbox View - Android User Interface

Android examples for User Interface:CheckBox

Description

update Checkbox View

Demo Code


//package com.java2s;
import android.view.View;

import android.widget.CheckBox;
import android.widget.CompoundButton.OnCheckedChangeListener;

public class Main {
    public static void updateCheckbox(View view, int id,
            OnCheckedChangeListener onCheckedChangeListener) {
        if (null != view) {
            CheckBox checkBox = (CheckBox) view.findViewById(id);

            if (null != checkBox)
                checkBox.setOnCheckedChangeListener(onCheckedChangeListener);
        }//from   w ww . j  a va 2  s .c om
    }
}

Related Tutorials