Questions tagged [android-radiobutton]

Use for the android.widget.RadioButton element. Radio buttons are normally used together in a RadioGroup.

Radio buttons allow the user to select one option from a set. You should use radio buttons for optional sets that are mutually exclusive if you think that the user needs to see all available options side-by-side.

Radio buttons are normally used together in a RadioGroup. When several radio buttons live inside a radio group, checking one radio button unchecks all the others.

Useful links

347 questions
0
votes
1 answer

Android : Button and left border in Radio Button

Is there any way to give Space between radio Circle and left border. I'm tried to give margin but it's not working ,I also try to give padding but it increase space between text and button. Radio xml Code:
Rahul Bh
  • 123
  • 2
  • 15
0
votes
2 answers

AppCompatRadioButton using vector asset

I am having problems on 4.4 devices with using Vector Drawables. First of all i switched my RadioButton to AppCompatRadioButton so i could use vectors. Thing is i am not sure how i am supposed to use them as i have indicator in xml…
HyperX
  • 1,121
  • 2
  • 22
  • 42
0
votes
1 answer

Change the color of radioButon when one of the options is selected in Android

I have developed a dynamic UI of survey questions, where I have questions answering "YES" or "NO". For questions having answers as Yes/No, I have taken radio-group for user input. How to change the color of the Radio button Highlight color for a…
0
votes
1 answer

How to handle onCheckedChangeListener in RadioGroup inside Recyclerview which is called while setting the state of the RadioGroup?

I am trying to add a radiogroup with 4 radiobuttons in a recyclerview. I am saving the state in room and taking it in adapter to set the appropriate radiobutton. While doing this I am using radiogroup.check() and radiogroup.clearchek() method inside…
theanilpaudel
  • 3,348
  • 8
  • 39
  • 67
0
votes
1 answer

Android RadioButton shows only text, not the actual button in device emulator

I have a group of radio buttons displaying fine in my XML design window, but in the emulator (and on my actual device that I installed the app on) it only shows the button text and not the button. Here is the XML file for this activity:
Connor S
  • 353
  • 2
  • 12
0
votes
0 answers

How to set default SELECT for radio button in radio group

I had created a dynamic radio group which contain onClickListener for each radio button when click. How can i set the first item in the radio group as default selected INCLUDING the onClick action for the first item. I had try with the…
0
votes
1 answer

RadioButton focus background shape

I want to add focus ripple effect to whole RadioButton, but there is something strange is happening to it when I try to use ripple effect with highlight. In the picture, left is what I get and right is what I want: background_drawable:
0
votes
1 answer

Set value from Firebase Realtime Database to RadioButton

Is there a way I can set a RadioButton with a string value in my Firebase Realtime Database? Is it possible? Below is my code. DatabaseReference questions_beg_java =…
0
votes
2 answers

How to align radiobutton with its text?

My RadioButtons are slightly above the text attached with them. As shown in the figure, how to resolve this issue? I want buttons to be positioned as normal. Which means the RadioButton circle should be visible in the middle alignment to the text…
0
votes
0 answers

BaseExpandableListAdapter rewrites new items over the old items

I am using BaseExpandableListAdapter to show titles with children. The children can be a Checkbox or a radiobutton, it depends of the parent of each one, so you can have a group which are radiobuttons or a group which are checkboxes. The problem is…
0
votes
1 answer

Saving selected RadioButton's text in model class from recyclerview item

From RecyclerView item, I am trying to save the selected RadioButton's text in model class. When I select a RadioButton from 1st item, it's text is saved appropriately. Problem is, RadioButton's text at the same position from 8th item is also auto…
Newaj
  • 3,992
  • 4
  • 32
  • 50
0
votes
0 answers

Adding RadioButtons Dynamically To RadioGroup breaks Mutually Exclusive Selection

This is inside a custom view class that extends RelativeLayout not inside an Activity or Fragment. My RadioGroup exists in my xml and I'm trying to dynamically add RadioButtons to it. The only time I've seen it where the mutual exclusivity does not…
Mike6679
  • 5,547
  • 19
  • 63
  • 108
0
votes
2 answers

Radio button get only checked radio in android studio

I currently working with a project and stuck on the radio button which getting only the checked radio in xml, I search many case regarding with this concern and still got the same problem. here is the activity which toasting only the checked radio…
0
votes
1 answer

Custom ListViewAdapter with Radio Buttons.

I am coding a listView that gets the data from mySQL Server. I have created the followings classes. Class ListView. It has two contractors all in Strings. And I sat getters and setters. I believe I have a problem with the Adapter its self. I can…
0
votes
1 answer

Android requestfocus on unchecked radiogroup and show error beside each unchecked radiogroup

I have set onclick event on a button(Submit). If the radio buttons of a radio group is not selected then I try to Toast message and focus/listview scroll the first unchecked radio group with error image beside or text(please select answer) as well…