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

Previously selected radio button not working

I am using json parsing, on button's click I have one alert dialog with listview and Radio Button . List is dynamically generated. by default first radio button of list is selected, Now issue is if I select second item and close the dialog , and…
chris
  • 699
  • 4
  • 12
  • 35
0
votes
0 answers

want to set default first radiobutton as checked, custom radiobutton with listView

I am using custom Radiobutton using listView, i want checked first radiobutton as default but not able to do it. when i am implementing the same for last radiobutton it is possible to checked as default. WHAT I WANT: when i clicked second…
TheMatrix
  • 91
  • 9
0
votes
1 answer

How to save RadioButton status with SharedPreference?

This is the app view: and here is my activity code: public class Quiz extends AppCompatActivity { public static int point; public static int i = 0; RadioGroup radioGroup; public static int totalPoint =0; int…
0
votes
2 answers

RadioButton value in android

Here's the scenario: I made some questions in one activity and every answer has a point(0 to 3). For example if the user select the first one, he gets 0 point, if he select the secound one he will get 1 point etc(2 point for the third one and 3…
0
votes
3 answers

Use RadioButtons within one activity

I am making a quiz app which there are some question: When the user clicks NEXT QUESTION, another question will be shown. I have made the current code: public void onRadioButtonClicked(View view) { // Is the button now checked? boolean…
Sina Amiri
  • 85
  • 1
  • 9
0
votes
1 answer

Android Studio Radio Button not read as selected when selected

I'm using an if statement to check which of two radio buttons in a radio group is selected but the app always thinks the second one is selected no matter what. I can't figure out why. @TargetApi(24) public class MainActivity extends…
MWTravesty
  • 13
  • 4
0
votes
2 answers

Android: Getting the Value of RadioButton from Custom View

I Have created a Custom view for the Radio Button Like this. How can i get the value of RadioButton from the custom view and want to select one radio Button at a time. public void getData(){ cappingLayout.removeAllViews(); for (Capping…
0
votes
1 answer

How to get radio button pop up when two date pickers have same date?

I am working on a simple app in which i have taken two date pickers they subtract two dates and display the result. But i want that if the two dates are same like 06/04/2017 then two radio button should pop up for selecting full day and half day as…
Kanchan
  • 11
  • 6
0
votes
0 answers

Android Webview(to render latex and html images) with Radiobutton

I am trying to develop a Maths Question and answer Native Android application where there are a dynamic number of answer options. And answers can contain Latex and image content. So I have to use Webview. Since User should be able to select only one…
0
votes
0 answers

How to get values from dynamic CheckBoxes and RadioButtons in android

I'm getting bellow Json response according to with I'm creating dynamic layout. I can create dynamic checkboxes and Radio Buttons but, I'm unable to fetch the values from those dynamic checkboxes and Radio Buttons. I tried to get the instance of…
Monojit
  • 3
  • 6
0
votes
2 answers

Radio Button crashes my app when clicking it

I am creating a simple calculator application on Android Studio, and I have run into this one problem I just cannot figure out. My calculator uses two radio buttons in order to calculate and two edit-text fields to get the numbers from the user.…
0
votes
1 answer

Strange behaviour of checked RadioButtons

I currently develop my own Quiz Application and considering with a problem for 2 days. My Quiz provides 2 variants of questions: multiple choice and single choice. So for the multiple choice questions I'm using CheckBoxes and for the single choice…
0
votes
1 answer

Change color of Radiobutton image drawable when clicked/pressed

I have a radio button that has both text and a image. I am trying to change the color of the image when the button is clicked by applying a color on top of it like a tint. I tried using android:state_checked="true" but it doesn't allow me to apply…
Bmbariah
  • 687
  • 2
  • 10
  • 22
0
votes
1 answer

How to set the CardView as the background for radio button dynamically from java code in android?

I need to put the CardView as background for radio button in android which i am creating dynamically. I have written xml for radio group and i am creating radio button and adding them dynamically. Now i need to put the background for the radio…
0
votes
1 answer

Getting text from a radio button that is part of a radio group

These are two methods I have in my class where I hope to return a string of the text attached to each radio button: public String toppingGroupCheck(RadioGroup toppingGroup, int checkedId){ switch (checkedId){ case…