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

Context Menu for ListView that contains radio buttons

I have a listview with a custom adapter, and a row layout. The row consists of a textview, imageview and a radio button. After implementing the method I am unable to obtain the position of the clicked view. @Override public void…
0
votes
1 answer

Android: set background color of radiobutton text programatically

When i try to change background color of radio button text programatically like this: rb.setBackgroundResource(R.drawable.mycustombackground); The background covers both the button and the text. I only want to change the background color of the…
Jasper
  • 8,440
  • 31
  • 92
  • 133
0
votes
1 answer

Unable to save the Background color on screen rotation

I am new to android application development, I am learning it by practicing few example and as well trying to implement my own ideas based on those examples...as a part of that i am trying to save the background color of the screen using Bundles and…
0
votes
1 answer

RadioButton isChecked control state android

Here is the case : i have 4 radioButtons that are not members of a radioGroup. Thats because RadioGroup places children in vertical order by default and cannot place them relative to each other.Right now , i am check all the radioButtons. What i…
0
votes
2 answers

Align radio buttons by their checkradio

I'm using two radio buttons inside a radiogroup one below the other. THe upper button has as text "to" and the other has "from". What I want is that both will be in the center but they will be aligned by their checkradio. I tried this :
Ilenca
  • 301
  • 2
  • 10
0
votes
1 answer

How to get id of selected radio button in a radio group

I am making a quiz app in which I have a viewPager which has 15 pages in it having 1 question each and a submit button at the last page.Now I want to get the Maximum number of option selected among 15 questions. Below is my…
0
votes
1 answer

Android radiobutton indicator hide

I want to hide radio button indicator, which shows that radio button is checked or unchecked. I just want to show its text only. And change text color of radio button which is selected in radio group and other radio buttons text will same. Here is…
user3555472
  • 836
  • 3
  • 11
  • 38
0
votes
1 answer

Dialog with radio button save sharedpreferences but not the behaviour

I can set the shared preferences in a AlertDialog with some radio buttons: public void ShowRadioDialog() { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); final SharedPreferences.Editor editor =…
0
votes
1 answer

How to hide image of previous radio button when user selects another radio button android?

when user click first item, it should get checked and image should visible and when clicking second item, first item tick box should become invisible and so on. Inoroder to place image at right, i made custom drawable icon by placing at right. Code…
Shadow
  • 6,864
  • 6
  • 44
  • 93
0
votes
1 answer

Open websites after selection is made via radio buttons

Trying to open websites after they get selected via radio buttons and I am not having much success. Tried WebView but realized that I need to use fragments, and I am not very comfortable with how to do that. I am new to Java/android programming, so…
0
votes
2 answers

Android NullPointerException: java.lang.widget.RadioButton.getId() on a null object reference

I have one simple code which implements RadioGroupButton and CheckBox. When the app was started on emulator, no exception, but when i clicked the radio button, it threw the exception and i noticed from LogCat, there was this NullPointerException…
Rui Huang
  • 382
  • 1
  • 5
  • 18
0
votes
3 answers

How to get the values of radio buttons from Custom Listview in Android?

This is a custom listview by extending the BaseAdapter. I need to get the values of the selected radio button, but I don't know how. So please help me. Below is the Custom Adapter class. public class CustomArrayAdapter extends BaseAdapter…
0
votes
1 answer

DialogFragment RadioGroup onClick NullPointerException

I'm getting an NPE on my code. I'm trying to get the value of the selected RadioButton. When I click the Button the Exception gets fired, don't know why, I could imagine that it takes the wrong view... import android.app.Activity; import…
0
votes
1 answer

How To ReGroup All RadioButtons Added Programmatically To A Programmatically Added TableRow On Runtime? Must have 1 RadioButton per TableRow

I have a table layout that is inflated with table rows that are made inside java. Now, each row will have to have a RadioButton. I have a button that adds a table row every time it's clicked. on adding the rows, one and only one radio button has to…
superlinux
  • 476
  • 1
  • 4
  • 12
0
votes
1 answer

Android: EditText in between RadioButtons of a RadioGroup

Is it possible to have an EditText in between RadioButtons held in a RadioGroup as depicted in the link? EditText between RadioButtons