get CheckBox Value - Android User Interface

Android examples for User Interface:CheckBox

Description

get CheckBox Value

Demo Code


//package com.java2s;

import android.view.View;

import android.widget.CheckBox;

public class Main {
    public static boolean getCheckBoxValue(View parent, int id) {
        CheckBox cb = (CheckBox) parent.findViewById(id);
        return cb == null ? false : cb.isChecked();
    }// w w  w .  j av a  2 s  .c  o  m
}

Related Tutorials