set CheckBox Value - Android User Interface

Android examples for User Interface:CheckBox

Description

set CheckBox Value

Demo Code


//package com.java2s;

import android.view.View;

import android.widget.CheckBox;

public class Main {
    public static void setCheckBoxValue(View parent, int id, boolean checked) {
        CheckBox cb = (CheckBox) parent.findViewById(id);
        cb.setChecked(checked);//from   ww w  .ja  v a  2  s  . c o  m
    }
}

Related Tutorials