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
0 answers

How to get selected radio button text from radio group in array list in android

I have created Recycler view with header. And added items with dynamic radio button. Here is my xml
0
votes
1 answer

Enable view when RadioButton checked

I have a View (i.e. a TextInputLayout, Button, whatever) that is disabled but once the RadioButton is checked I want to enable that view. And, once the radioButton is unchecked, I want that view to be disabled. I want to do it using DataBinding, but…
0
votes
1 answer

Why is radiogroup doesnt called

I have a radio group with 3 radio buttons. When I clicked radio buttons, animation is changing but oncheckedchangelistener doesn't called. none of logs are printing, so I think it must be the listener but I can't see anything wrong. I followed…
0
votes
0 answers

How to determine spinner string array list item when a radio button is selected in android?

I'm confused about how to determine the array for my spinner based on the selected radio button. So I have 1 spinner and 1 RadioButtonGroup contain with 2 RadioButtons. My case is like : If RadioButton_A is selected then the spinner will display…
0
votes
1 answer

How to set text (Alignment First) followed by radiobutton on MaterialRadioButton in android

How to achieve this design. (First text then radio button) Here is my code
0
votes
0 answers

How to display RadioButton unchecked without seeing the unchecking operation?

I have 2 separate layout files: The first one contains 3 radio buttons (no RadioGroup used). The user has to choose the correct answer. After checking an option, when the user clicks the button, I hide the Layout1 and display the Layout2 with the…
Ivan Patrice
  • 119
  • 9
0
votes
0 answers

How to save radio button value into Firebase Cloud Firestore

I've tried to find this kind of tutorial in YouTube but I cant seem to find it. Most of the storing radio button value tutorial is only for Firebase Realtime Database but not for Firebase Cloud Firestore
0
votes
1 answer

Whne i call this radiogroupId.clearCheck() this method recall radiogroup click listener

Details: I have 2 radio groups with some radio buttons. What i want: User only select one radio button from 2 groups. What i have done: rgOne.setOnCheckedChangeListener(RadioGroup.OnCheckedChangeListener { group, checkedId -> try { …
0
votes
0 answers

How do I change the text of EditText or a TextView in another activity based on 2 radio button selections from 2 different radio groups?

I am new to Java and Android Studio. I am trying to create a app where a user selects an option from a list of radio buttons and there are multiple of these activities. In the last activity, I would like to display certain text based on which 2…
user14473021
0
votes
1 answer

Assign a unique integer value such as(10, 20, 30, …) to each Radio Button in a Radio Group and return that value for Printing in Android

Trying to assign each Radio Buttons in a Radio Group, with a unique Integer value or id such as 10,20,30...so-on, and return the particular value/id for further actions such as printing that id or sending it to the backend. For eg. : for RadioButton…
0
votes
0 answers

Checked radio button is showing as checked in RadioGroup

I'm using multiple RadioGroup and on page load based on service response I'm setting checked one radio button from each RadioGroup, but its not showing as checked. plz help
0
votes
2 answers

Android RadioButton not centering

I have the following RadioButtons: They are generated programmatically in this method: private void initializeAbilityComponents() { rgAbility = view.findViewById(R.id.rgAbility); for (int i = 0; i < abilities.size(); i++) { …
0
votes
1 answer

Android: Radio Button label with only digits is not distributed evenly across width

I am trying to create a RadioButton in android. My requirement is that the label should be always left aligned and icon should be right aligned(evenly distributed, as first item in attached screenshot). I was able to achieve it. But this is not…
Sohan
  • 66
  • 1
  • 4
0
votes
1 answer

How to set layouts instead of text in RadioButton

Normally Radio Buttons, you can have text along with them, is there a possibility to add a layout instead of text as shown in figure below? P.S: I have kept all the radio buttons in a radio group. Just for this layout sake, i don't want to create a…
0
votes
1 answer

How to align radio buttons in radio group in front of each other?

I want to align my radio buttons in front of each other. My radio buttons are in the radio group and my parent layout is a constraint layout. How to do that? I tried by putting the radio group into a child relative layout but it's not working. I…