Questions tagged [android-radiogroup]

This class is used to create a multiple-exclusion scope for a set of radio buttons. Checking one radio button that belongs to a radio group unchecks any previously checked radio button within the same group.

This class is used to create a multiple-exclusion scope for a set of radio buttons. Checking one radio button that belongs to a radio group unchecks any previously checked radio button within the same group.

Intially, all of the radio buttons are unchecked. While it is not possible to uncheck a particular radio button, the radio group can be cleared to remove the checked state.

The selection is identified by the unique id of the radio button as defined in the XML layout file.

XML Attributes

See RadioGroup Attributes, LinearLayout Attributes, ViewGroup Attributes, View Attributes

Useful links

315 questions
5
votes
4 answers

Android: Horizontal Center Align for Radio Group

I have Radio Group which appears left aligned on screen. How can i horizontally center the radio group. The TextView itself appears properly center-aligned horizontally. ....
Jasper
  • 8,440
  • 31
  • 92
  • 133
5
votes
3 answers

Android dynamically generated radio buttons not unchecking once setChecked programmatically

I can't get the below dynamically generated RadioButtons to uncheck when I click on other RadioButton in the same RadioGroup. I have even resorted to writing my own handler that clears the RadioGroup (below), and tried another that make all…
james pearce
  • 355
  • 1
  • 5
  • 20
4
votes
1 answer

Get value of radio button in custom alert dialog

I have created a custom alertdialog with a radiogroup, radiobuttons, and edittext. The goal is to trying to get the text value from the selected radiobutton and the edittext. At this point, I can only get the value entered in the edittext. I have…
4
votes
4 answers

ConstraintLayout, RadioGroup and two columns of RadioButton

I have a ConstraintLayout as a root Layout and it's fine. However I now have a RadioGroup where I have to make two columns of RadioButtons within it. Since ConstraintLayout is about getting the rid of Nested Layouts, I thought it would be fine…
4
votes
3 answers

Android. ImageView as RadioButton

I want some ImageViews to work as RadioButtons. But I don't want the mini-button of a RadioButton to select it; I want this mini-button to disappear, and the ImageView to be the entire button. Thus, a solution like the following one is not…
4
votes
3 answers

Android: How to vertically-align:top a Radio button to a multiline text?

As you can see, I got a simple RadioGroup and its options.
neoswf
  • 4,730
  • 6
  • 39
  • 59
4
votes
3 answers

Android: custom layout for Radio Group

I'm trying to create a 2x2 array of radio buttons, but I don't know how to customize layout other than horizontal or vertical. Any ideas? I've only gotten A B C D and A B C D but I want to have A B C D EDIT: I resolved this issue. For anyone…
rjvani
  • 41
  • 1
  • 3
4
votes
1 answer

How to set focus on spinner from edit text soft keyboard next button click?

Example: I've registration form fields like: Enter Name -> Edit text (default set focus) Gender -> radio button list (a.male and b.female) City list-> Spinner I want to make like these: Fragment is load and focus on edit text filed and open a…
4
votes
1 answer

How to make a RadioGroup scrollable in Android?

I have a simple layout wherein there is a TextView, followed by a RadioGroup followed by another TextView (and finally an Admob adview). I am trying to make the RadioGroup scrollable and for the life of me, I cannot seem to make it do that. Please…
Azeem Khan
  • 43
  • 1
  • 4
3
votes
6 answers

Checked RadioButton Recycling

I'm adding radiogroups programatically to my recyclerview and it's working fine. But when I check it and scroll the recyclerview it loses checked radios. I've seen many ways and examples of solutions, but I cannot achieve it. It's been some days in…
Alan Godoi
  • 657
  • 1
  • 12
  • 39
3
votes
2 answers

Android RadioButton *with* icon and center aligned

Is it possible to create a horizontal RadioGroup, with RadioButtons where each button includes a radio, icon, and text, and these three items are vertically-center-aligned with each other? I have tried to set the gravity and layout_gravity on the…
jungledev
  • 4,195
  • 1
  • 37
  • 52
3
votes
5 answers

How to set Radio Group View to not clickable

I want to set my RadioGroupView to not clickable so that the user can't click on the buttons. I tried mRadioGroup.isActivated = false but it has no effect on my RadioGroup View. Have somebody a hint for me?
dudi
  • 5,523
  • 4
  • 28
  • 57
3
votes
3 answers

How to create dynamic Radio-Group in Flutter/Dart (Android)

Below code i have used to create in simple android what i have to do for an Flutter/Dart, i am totally new to flutter/Android public static void setCustomRadioGroup(LinearLayout layout, Context context, ArrayList setName, ArrayList
sidd shadab
  • 123
  • 1
  • 11
3
votes
2 answers

TableLayout of radiogroup(s) with respective label(s) aligned in android

I'm creating a feedback input form which takes user selection from radio buttons just like below image. So i took a table layout and added table rows with textviews of fixed width in first row and a textview with radio buttons of fixed width for…
3
votes
2 answers

Set color text RadioButton checked in RadioGroup with custom Shape

I have a problem, I can't change text color to RadioButton if it's selected. I have this in activity.xml
LorenzoBerti
  • 6,704
  • 8
  • 47
  • 89
1
2
3
20 21