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

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

Android RadioButton examples from Open Source projects
This code example shows how to use the following methods: isChecked, setChecked
18:	RadioButton radioButton = new RadioButton(null); 
19:	assertFalse(radioButton.isChecked()); 
-
21:	radioButton.setChecked(true); 
22:	assertTrue(radioButton.isChecked()); 
-
24:	radioButton.setChecked(false); 
25:	assertFalse(radioButton.isChecked()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setVisibility
168:	mRadioButton.setVisibility(GONE); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setClickable, setChecked, setOnCheckedChangeListener
71:	rb.setClickable(true); 
-
73:	rb.setOnCheckedChangeListener(this); 
-
82:	rb.setChecked(isChecked); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setClickable, setFocusable, setChecked
31:	mRadioBtn = new RadioButton(context); 
32:	mRadioBtn.setChecked(textSelected.getSelected()); 
33:	mRadioBtn.setFocusable(false); 
34:	mRadioBtn.setClickable(false); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setVisibility
162:	if (mRadioButton != null) mRadioButton.setVisibility(GONE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setVisibility
168:	mRadioButton.setVisibility(GONE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getId
62:	return radioButton.getId(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked, getText
41:	if(radioMale.isChecked()) { 
42:	resultIntent.putExtra("dlr.stressrecognition.Gender", radioMale.getText()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId, setTag, setChecked, setText
30:	RadioButton rb = new RadioButton(getContext()); 
31:	rb.setText(text); 
32:	rb.setTag(target); 
33:	rb.setId(id++); 
34:	rb.setChecked(isSelected); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnClickListener, setVisibility, setChecked
94:	rb.setVisibility(View.GONE); 
-
108:	rb.setVisibility(View.VISIBLE); 
-
110:	rb.setChecked(true); 
-
113:	rb.setChecked(false); 
-
117:	rb.setOnClickListener(new OnClickListener() { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
56:	return gnugo_plays_white_radio.isChecked(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setVisibility
168:	mRadioButton.setVisibility(GONE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId, setLayoutParams, setText, setTextSize
37:	RadioButton radioButton = new RadioButton(context); 
-
39:	radioButton.setId(radioButtonId); 
40:	radioButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); 
41:	radioButton.setText(radioButtonText); 
42:	radioButton.setTextSize(12.0f); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnCheckedChangeListener, setText
37:	RadioButton button = new RadioButton( context); 
-
47:	button.setOnCheckedChangeListener(l); 
48:	button.setText( board.getName() ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked
90:	preferences.edit().putBoolean(USE_ANDROID_PROXIMITY_TYPE_KEY, androidProximityTypeRadioButton.isChecked()).commit(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnCheckedChangeListener, setText
37:	RadioButton button = new RadioButton( context); 
-
47:	button.setOnCheckedChangeListener(l); 
48:	button.setText( board.getName() ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setChecked, setText
49:	if (label != null) view.setText(label.getNodeValue()); 
-
52:	view.setChecked(checked.equals("yes")); 
53:	AmlBuilder.applyActionAttribute(view, "tap", n.getAttributes().getNamedItem("tap")); 
54:	AmlBuilder.applyActionAttribute(view, "hold", n.getAttributes().getNamedItem("hold")); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setText, setTextColor, setTextSize
96:	radioAnswer.setTextColor(Color.BLACK); 
97:	radioAnswer.setText(answer); 
98:	radioAnswer.setTextSize(15); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setVisibility
162:	if (mRadioButton != null) mRadioButton.setVisibility(GONE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId, setOnClickListener, setChecked
45:	RadioButton radioButton = new RadioButton(getApplicationContext()); 
46:	radioButton.setOnClickListener(this); 
47:	radioButton.setId(i); 
-
49:	radioButton.setChecked(true); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId, setChecked, setText
60:	RadioButton radioButton4 = new RadioButton(this); 
61:	radioButton4.setText("�I�v�V���������]���Ȃ�"); 
62:	radioButton4.setId(2); 
63:	radioButton4.setChecked(true); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId, setChecked, setText
36:	RadioButton button = new RadioButton( getContext() ); 
37:	button.setText( strings.getAttributeValue("jsxtext") ); 
-
39:	button.setId( num_buttons ); 
-
48:	button.setChecked( element_text.compareTo( button_value ) == 0 ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId, setText, setTextColor
99:	RadioButton radioButton = new RadioButton(context); 
100:	radioButton.setId(radioButtonId); 
101:	radioButton.setText("RadioButton" + radioButtonId); 
102:	radioButton.setTextColor(Color.WHITE); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setId, setText, setTextColor
62:	RadioButton rd0 = new RadioButton(this); 
63:	rd0.setId(0); 
64:	rd0.setText("�����N�P"); 
65:	rd0.setTextColor(Color.rgb(0, 0, 0)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setId, setOnClickListener, setTag, setText
374:	RadioButton rb = new RadioButton(this); 
-
376:	rb.setId(index); 
-
394:	rb.setText(result, BufferType.SPANNABLE); 
395:	rb.setTag(urlText); 
-
437:	rb.setOnClickListener(this); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setBackgroundColor, setChecked, setEnabled, setTextColor
57:	mRadioButtonB.setEnabled(false); 
-
69:	mRadioButtonB.setChecked(bValue[1]); 
-
116:	btn.setTextColor(fontColor); 
117:	btn.setBackgroundColor(bgColor); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setClickable, setLayoutParams
26:	cb = new RadioButton(context); 
-
29:	cb.setLayoutParams(cblp); 
30:	cb.setClickable(false); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setId, setText
60:	final RadioButton b = new RadioButton(getContext(), null); 
61:	b.setText(getContext().getString(resid)); 
62:	b.setId(id); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isChecked
69:	s.setDisplayCelsius(scaleC.isChecked()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setId, setLayoutParams, setOnTouchListener, setText, setTextColor
129:	RadioButton radioButton = new RadioButton(context); 
130:	radioButton.setId(integerId); 
131:	radioButton.setText(text); 
132:	radioButton.setTextColor(Color.WHITE); 
-
134:	radioButton.setLayoutParams(params); 
135:	Home.getHome().getLayout().addView(radioButton, params); 
136:	radioButton.setOnTouchListener(new DragListener(radioButton)); 
-
144:	ViewCollection.getInstance().addView(radioButton); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setId, setButtonDrawable, setText
146:	radiobutton.setButtonDrawable(0x7f020060); 
147:	radiobutton.setId(Math.abs(s.hashCode())); 
148:	radiobutton.setText(i); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setChecked, setText
136:	RadioButton rb13 = new RadioButton(context); 
-
138:	rb13.setText("My location"); 
-
143:	rb13.setChecked(true); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setClickable, setChecked
65:	tb.setChecked(true); 
-
68:	tb.setClickable(false); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isChecked
66:	else if (rb3.isChecked()) 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setVisibility, setText
46:	noCommentsButton.setVisibility(View.VISIBLE); 
-
48:	noCommentsButton.setText(noCommentsText); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setVisibility
176:	mRadioButton.setVisibility(GONE); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isChecked, getText
48:	} else if (beta.isChecked()) { 
49:	tv.setText(beta.getText()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isChecked, setChecked
52:	if (mCelsiusButton.isChecked()) { 
-
54:	mCelsiusButton.setChecked(false); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getId, getText
42:	if(checkedId==mRadio1.getId()) 
-
45:	mTextView1.setText(mRadio1.getText()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getId, getText
32:	Log.d(TAG, "" + radio.getId()); 
33:	Log.d(TAG, "" + radio.getText()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getText
243:	selected.getText().toString()).getPath()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setOnClickListener, setChecked
33:	mPreferenceButton.setOnClickListener(this); 
34:	mPreferenceButton.setChecked(mChecked); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setChecked
33:	preferRadioButton.setChecked(true); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isChecked, setChecked
56:	radioTwo.setChecked(!radioTwo.isChecked()); 
Full Snippet Info
5
CodeRank
Related Android RadioButton Questions & Answers:
Other Android RadioButton Examples
1:	public void onRadioButtonClicked(View view) {
2:	    // Is the button now checked?
3:	    boolean checked = ((RadioButton) view).isChecked();
4:	    
5:	    // Check which radio button was clicked

Read More

See Code Examples for Android RadioButton Methods: