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

getting selected radiobutton text as string

I have created two activity one for registration details and another one for showing the value user has entered. But when I tried to get the value of radiobutton from the radiogroup selected. It doesn't show any error but when I debug and run in my…
A R DANISH
  • 3
  • 1
  • 6
0
votes
2 answers

uncheck radiobutton/radiogroup on Button click - Android

I am using radiobuttons in my radiogroup and each radiogroup is generated dynamically. I want all radiogroup unchecked in more specific I want all radiobuttons in radiogroup should be unchecked when user click on clear button. I using radiogroup in…
0
votes
0 answers

Custom button with text on RadioButton

I need to dynamically change the text in the drawable of a RadioButton. It should look something like this Where the A should be able to change. My first thought was to set a shape-drawable background to a TextView (to get the border around the A)…
Algar
  • 5,734
  • 3
  • 34
  • 51
0
votes
1 answer

Android: Scale background image of RadioButton or another way to make a RadioButton an Image

I'm making an app that is related to a card game and as such has many images of cards appear throughout the app. In one section I need the user to select one of four cards, with only one selection ever being possible and I want to have the card to…
0
votes
1 answer

Recyclerview get data from radiobutton

I want select only one radio button in recyclerView and get its data in its Activity. I have gone through following solutions : Single selection in RecyclerView Select only one radiobutton in a recyclerview And I made one solution : private…
Annie
  • 2,397
  • 3
  • 18
  • 26
0
votes
0 answers

Radio buttons are not displaying when using AlertDialog in android

This is my code which I have used in one of my activivty. CharSequence[] values = {" one "," two"}; AlertDialog alertDialog; AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setTitle("Select Yout…
0
votes
0 answers

Checked state not displayed after resuming fragment

I am creating radiobuttons in a radiogroup dynamically. When using the saved instance state to set which radiobutton was selected before the app shut down the correct radiobutton gets checked, but it doesn't display the checked state. By logging…
elin
  • 71
  • 1
  • 2
0
votes
2 answers

Making a Custom RadioButton

I'm trying to make a custom RadioButton like this: I tried making a RadioGroup with three RadioButton in it with the background of the RadioGroup being a rectangle and the background of the RadioButton would be a blue rectangle when checked and…
0
votes
0 answers

Best practice to set text next to radiogroup radiobuttons android

I am generating a radiogroup dynamically. Then I add some radio buttons dynamically to this group. Now my Problem is, that I want to split the text of the radiobutton, that one part is directly on the left of the rbutton and the other part on the…
progNewbie
  • 4,362
  • 9
  • 48
  • 107
0
votes
1 answer

Radio Button not selected when scroll in listview in android

When I scroll down in android ListView, RadioButton can't selected . i apply set selected true on set change check listener , not working , need help. thanks advance. I use a custom adapter that used 4 RadioButton and set mcq answer option . 50 mcq…
0
votes
1 answer

How to make RadioButton text invisible but the button itself to stay visible(Xamarin.Android)?

Is there a way to hide the text of a RadioButton but the button itself(the circle) to stay visible?
0
votes
0 answers

How to make a radio button able to get unchecked?

I got a radio button in a radio group. It is dynamically created, so I haven't got the reference to the radio group the button is in. I would like to make it able for the app user to uncheck a radiobutton by again clicking on it. I tried a view…
progNewbie
  • 4,362
  • 9
  • 48
  • 107
0
votes
2 answers

Error setting value from RadioButton

I keep getting an error when trying to set value to a variable from a RadioButton. The error is the following: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.aquino.myapp3, PID: 17484 java.lang.NullPointerException: Attempt to invoke…
Lua
  • 57
  • 8
0
votes
1 answer

Custom AppCompatRadioButton with Toggle Drawable right of text

I'm try to set `Toggle Drawable' to right of AppCompatRadioButton' text with public class mRadioButton extends AppCompatRadioButton { public mRadioButton(Context context) { super(context); init(); } ... private void init() { …
Saeid
  • 2,261
  • 4
  • 27
  • 59
0
votes
1 answer

Issue with RadioButton with RadioGroup in Android using a toggle feature/isChecked and cleaning code up

Hi I been trying for a while and going through lots of theories and stack answers. Though I just can't figure out how to take the code below for a simple trivia app, using a RadioButton in a RadioGroup, then add one to score when checked. The issue…
Bazz
  • 34
  • 8