Best code examples for Android CheckBox class (android.widget.CheckBox)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android CheckBox class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android CheckBox examples from Open Source projects
This code example shows how to use the following methods: isChecked
315:	CheckBox checkBox = new CheckBox( null ); 
316:	assertTrue( false == (Boolean) androidWidgetBuilder.getValue( checkBox ) ); 
317:	androidWidgetBuilder.setValue( true, checkBox ); 
318:	assertTrue( checkBox.isChecked() ); 
319:	assertTrue( true == (Boolean) androidWidgetBuilder.getValue( checkBox ) ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setId, setLayoutParams, setChecked, setOnCheckedChangeListener
113:	checkbox = new CheckBox(getContext()); 
114:	checkbox.setLayoutParams(checkboxparams); 
115:	checkbox.setOnCheckedChangeListener(this); 
116:	checkbox.setId(CHECKBOX_ID); 
-
145:	checkbox.setChecked(ison); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked, setChecked
41:	setChecked(!mCheckbox.isChecked()); 
-
78:	mCheckbox.setChecked(checked); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
65:	storePasswordView.isChecked(), 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setChecked
53:	mCheckBox.setChecked(checked); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setOnClickListener, setChecked, setGravity, setPadding
122:	CheckBox checkBox = new CheckBox(Plugins_View.this); 
123:	checkBox.setLayoutParams(lp); 
-
125:	checkBox.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER); 
-
127:	checkBox.setOnClickListener(new OnClickListener(){ 
-
142:	checkBox.setPadding(36, 0, 0, 0); 
143:	checkBox.setText(getChild(groupPosition, childPosition).toString()); 
-
145:	checkBox.setChecked(settings.getBoolean(getChild(groupPosition, childPosition).toString(), true)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTag, setChecked, setOnCheckedChangeListener
243:	checkBox.setTag(position); 
244:	checkBox.setChecked(selected); 
245:	checkBox.setOnCheckedChangeListener(this); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
33:	mIsPublic = mPublicCheckBox.isChecked(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setOnCheckedChangeListener, setSelected
144:	cbxAccelerometer = new CheckBox(this); 
145:	cbxAccelerometer.setSelected(false); 
-
148:	cbxAccelerometer.setLayoutParams(p); 
149:	cbxAccelerometer.setOnCheckedChangeListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
92:	if (mCheckBox2.isChecked()) ft.show(mFragment2); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setVisibility
167:	mCheckBox.setVisibility(GONE); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setChecked, setOnCheckedChangeListener, setText
53:	checkBox.setText(tag.getTag()); 
54:	checkBox.setOnCheckedChangeListener(null); 
55:	checkBox.setChecked(isChecked(tag.getTag())); 
56:	checkBox.setOnCheckedChangeListener(this); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
38:	return mCheckBox.isChecked(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setOnClickListener, setChecked
59:	pref_checkbox.setChecked(stateChecked); 
60:	pref_checkbox.setOnClickListener(checkboxClick); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setChecked
172:	mEnabledCheckbox.setChecked(myState.mEnabled); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setFocusable, setId, setVisibility, setChecked
48:	mCheckbox = new CheckBox(context); 
49:	mCheckbox.setChecked(false); 
50:	mCheckbox.setFocusable(false); 
-
52:	mCheckbox.setVisibility(View.VISIBLE); 
-
56:	mCheckbox.setId(mCheckbox_id); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
238:	dialogState.putBoolean(STATE_PHONE, mBlockCalls.isChecked()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getContext, isChecked
13:	if (!checkBox.isChecked()) 
14:	mc.registerFieldError(checkBox, getFormattedFeedbackMessageString(checkBox.getContext())); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setLayoutParams, setChecked, setText
124:	CheckBox checkbox = new CheckBox(context); 
125:	checkbox.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); 
126:	checkbox.setText(mLabel); 
127:	checkbox.setChecked(mChecked); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked, setChecked
120:	checkBox.setChecked( !checkBox.isChecked() ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
58:	return mCheckBox.isChecked(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setVisibility
167:	mCheckBox.setVisibility(GONE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setText
35:	mButton = new CheckBox(getContext()); 
36:	mButton.setText("Click Anywhere On Screen"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
81:	boolean create_account = mCreateAccount.isChecked(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setVisibility
161:	if (mCheckBox != null) mCheckBox.setVisibility(GONE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
110:	mMap.setMyLocationEnabled(mMyLocationCheckbox.isChecked()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
96:	if (setTransientStateCB.isChecked()) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
93:	if (mCheckBox2.isChecked()) ft.show(mFragment2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
83:	animView.startAnimation(endCB.isChecked()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
91:	if (mCheckBox2.isChecked()) ft.show(mFragment2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
98:	v.startAnimation(mCheckBox.isChecked() ? 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
123:	bundle.putBoolean(KEY_INCLUDE_ACCOUNT_NAME, mIncludingAccountNameCheckBox.isChecked()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
101:	if (mCheckBox.isChecked()) { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
89:	if (mCheckBox1.isChecked()) ft.show(mFragment1); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
92:	enabled = onscreenCalculatorCheckbox.isChecked(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
57:	data.put("checked", c.isChecked()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
42:	sendTextResult(checkbox.isChecked() ? "true" : "false"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
90:	if (mCheckBox1.isChecked()) ft.show(mFragment1); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
93:	if (mCheckBox2.isChecked()) ft.show(mFragment2); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChecked
52:	return mCheckbox.isChecked(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
93:	mFlipImageView.setRotationXEnabled(mCheckBoxX.isChecked()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
50:	if(chkMenuExtendido.isChecked()) 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
38:	return mLockBox.isChecked(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
154:	setShowPassword(mShowPasswordCheckBox.isChecked()); 
Full Snippet Info
6
CodeRank
Related Android CheckBox Questions & Answers:
Other Android CheckBox Examples
1:	public void onCheckboxClicked(View view) {
2:	    // Is the view now checked?
3:	    boolean checked = ((CheckBox) view).isChecked();
4:	    
5:	    // Check which checkbox was clicked

Read More

See Code Examples for Android CheckBox Methods: