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

Custom radio group not responding to onCheckChanged listener

I have created a custom three-button radio group programmatically. However, when I use the object in my fragment and set an onCheckChangedListener, it appears to not be responding. Here is the code for my radioGroup: public class…
user4875457
0
votes
3 answers

How to display EditText input in another activity when Radio Button is checked?

I am currently working on this activity (class ChallengeNew52) wherein I have a set of RadioGroup. In this RadioGroup, I have an EditText (id.etGoalNew) that is under a RadioButton (id.rButtonwithGoal). When this RadioButton is checked (active), it…
0
votes
1 answer

Multiple radiobutton selecion issue- dynamic radiobutton creation

I am getting issue with radiobutton. I have created dynamic radiobuttons but i am able to multiple select.I need to check only one as per radiobutton functionality. Here is my code: List answers =…
0
votes
1 answer

Android RadioGroup listener on start activity

What code do I need to write to have my listener call out the checked Radio Button? Here's my code: public class TabFragment1 extends Fragment { RadioGroup radioGroup; RadioButton radioButtonJa, radioButtonNee; @Override public…
Arjen de Jong
  • 1,051
  • 1
  • 7
  • 15
0
votes
1 answer

RadioButton Clear Check Action

I have a simple program that has 3 radio buttons in a group. When I click on any of the radio buttons I have a Toast appear to let the user know which button they have selected. My problem I am facing is I have a onClick event for a button that…
user2683183
  • 243
  • 2
  • 7
  • 23
0
votes
1 answer

I am getting java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 in the line rb[optionNo].setText(optionName);

Code private void createOptionsView(int optionType, final int optionNo, String optionName, final RadioGroup radioGroup,final int pos,final int numberOfOptions) { if (optionType == 1) { final RadioButton[] rb = new…
Anil Bhat
  • 21
  • 1
  • 3
0
votes
2 answers

How to disable radiobutton's text from clickable feature?

I need to select radio button while touching only the icon of a radio button. By default when i touch on the radio button's text, the radio button also get checked. How can i disable the feature?
JITHIN GOPAL
  • 131
  • 1
  • 14
0
votes
1 answer

Radio Group remembers old items

In my "FilterChoice" activity, I create the layout dynamically. I create a Radio Group and add Radio Buttons in it depending on the size of an ArrayList. There's a list in my "Filters" activity. The radio buttons are different depending on the…
alu
  • 277
  • 1
  • 3
  • 12
0
votes
3 answers

Android: Modifying Object's Fields With Its Own Click Listener

I have several radio buttons, each of which has a View.OnClickListener. The whole purpose of those listeners are for me to be able to change the color of the text associated with the RadioButton upon clicking this very RadioButton. My problem is,…
Loïs Talagrand
  • 810
  • 2
  • 13
  • 32
0
votes
1 answer

Change RadioButtonColor using code pre API 21

In my application I create RadioButtons dynamically using code. RadioGroup radioGroup = new RadioGroup(context); radioGroup.setOrientation(LinearLayout.HORIZONTAL); RadioButton yesRadioButton = new RadioButton(context); …
Owen Nel
  • 367
  • 3
  • 9
  • 21
0
votes
1 answer

how to set RadioButton left margin dynamically based on api level

Having layout as content for ALertDialog like:
lannyf
  • 9,865
  • 12
  • 70
  • 152
0
votes
1 answer

Saving radio button state and repopulating the state

I have a custom ArrayAdapter which is populated by a layout containing a radio button with single choice mode. I managed to save the items added to the ListView and repopulate the ListView when the activity is destroyed but checked radio buttons…
0
votes
3 answers

RadioGroup button spacing issue

I have a RadioGroup with 4 custom RadioButtons, using icons as a new radio button, with no text. I am having trouble getting them to space out evenly. Below is a screen show and my layout code:
0
votes
2 answers

RadioButton text Android API 16

I'm having an issue with RadioButton on Android API 16. This issue is not there on newer API level. I found many other problems related to RadioButton in API 16, but none of them resolves my issue. The text of the RadioButton starts inside the…
Pygmay
  • 75
  • 2
  • 9
0
votes
2 answers

Radiobuttons in a radioGroup in a multiple rows

Is it possible to create a RadioGroup that will hold radio buttons by 3 in a row? I've checked the internet for an implementation and I found one, but it was not working. The thing is that I need to add them programatically, and they should be…