I don't see any need to be storing your questions in the tags of the views. I feel that this may be part of the issue. What I usually do in this scenario is store an Integer index in the tag of a view that is actionable in a ListView....

for all who want create some quesioner like my self this code will help you, this code will loop RadioGroup and get the value from allradiogroup use List. and thanks for all people who help private List<RadioGroup> allradioGroup = new ArrayList<RadioGroup>(); private RadioGroup radioGroup; private List<RadioButton> allRadio = new ArrayList<RadioButton>();...

Here is an updated jsfiddle that works: https://jsfiddle.net/69z2wepo/8365/ The issue is that you're using what is a called an 'uncontrolled component' in React. See this page for more details: https://facebook.github.io/react/docs/forms.html Changing to a controlled component for your scenario means using checked instead of defaultChecked. defaultChecked is meant for uncontrolled components...

You have maintain the shared preference value for user selection and based on that values you have to show/hide the radio buttons programatically UPDATE You can select the first visible radio button in a radio group like below void selectFirstVisibleRadioButton(RadioGroup radioGroup) { int childCount = radioGroup.getChildCount(); for (int i =...

If it is an an activity: RadioButton levelbtn = (RadioButton) findViewById(R.id.radioextreme); levelbtn.setChecked(true); If it is in a fragment. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.page_two, container, false); RadioButton levelbtn = (RadioButton) v.findViewById(R.id.radioextreme); levelbtn.setChecked(true); return v; } You can also set a radio button...

You should change your android:button="@null" to android:button="@drawable/rb_germany" and remove background from each RadioButton. It will run fine. Your updated RadioButton should be like: <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/rb_spain" android:id="@+id/am_rb_spain" /> ...

I think you can define the strings separately, then do this in res/values/arrays.xml <resources> <string-array> <item>@string/radio_button1</item> <item>@string/radio_button2</item> <!-- etc --> </string-array> </resources> It's not great, but at least you don't define the strings twice....

You could use the following code snipet to set the text of your radio buttons dynamically: RadioGroup radioGroup = (RadioGroup)findViewById(R.id.grp_options); for (int i = 0; i < radioGroup .getChildCount(); i++) { ((RadioButton) radioGroup.getChildAt(i)).setText(*your value from JSON*); } ...

I was able to solve this on my own. Here's the answer for anyone who might come across the same issue.... I wrote a function in the class as protected RxAction<RadioGroup, String> setRadioButton() { return new RxAction<RadioGroup, String>() { @Override public void call(final RadioGroup radioGroup, final String selection) { RadioButton...

the problem is with the line : rg.setOnCheckedChangeListener(new OnCheckedChangeListener() rg is null because trying to get View from layout before calling setContentView. so swap both lines : setContentView(R.layout.activity_questions); RadioGroup rg = (RadioGroup) findViewById(R.id.radioGroup1); ...

RadioButton extends Textview basically, which means you can call getText() and setText (CharSequence text) on any object instance of RadioButton to get text from EditText is EditText.getText().toString() all these widget's mother is TextView Helpful?? ...