android-radiogroup

How to bind method on RadioGroup on checkChanged event with data-binding

可紊 提交于 2019-12-20 09:59:32
问题 I was searching over the internet for how to perform the new cool android data-binding over the RadioGroup and I didn't find a single blog post about it. Its a simple scenario, based on the radio button selected, I want to attach a callback event using android data binding. I don't find any method on the xml part which allows me to define a callback. Like here is my RadioGroup: <RadioGroup android:id="@+id/split_type_radio" android:layout_width="match_parent" android:layout_height="wrap

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

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-19 11:52:47
问题 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 code QuestionPagerFragment.java: public class QuestionPagerFragment extends Fragment { protected View mView; String pageData[]; //Stores the text to swipe. String optionData[];//Stores the option data. int rid; RadioGroup group; String ans; String ans1; String ans2;

How to get List item data in bindView when clicking on RadioButton in android?

萝らか妹 提交于 2019-12-18 09:49:13
问题 I have a ListItem having a person name e.g. ABCD and a RadioGroup having two RadioButtons . In my bindView() when i click any of RadioButton , it should update the data whose name is ABCD . But its only updating the lastItem shown in my ListView. Here is my BindView() : @Override public void bindView(View view, Context context, Cursor cursor) { holder = new Holder(); holder.stName = (TextView)view.findViewById(R.id.stName); holder.stName.setText(cursor.getString(cursor.getColumnIndex

Android radio group onCheckChangedListener crashing app

↘锁芯ラ 提交于 2019-12-18 07:18:21
问题 Any idea why this would crash my app when I select a radio button? I've imported android.widget.RadioGroup.OnCheckedChangeListener , and I've also tried new RadioGroup.OnCheckedChangeListener() which was the solution to a similar post. The code is (logcat added): RadioGroup ringtone_radio_group = (RadioGroup)findViewById(R.id.ringtone_radio_group); ringtone_radio_group.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int

Radio Button is only partially checked

大憨熊 提交于 2019-12-18 05:41:51
问题 I know this sound weird so here is the picture. It hold the correct value. The correct radiobutton is (partially) selected. All logic in the OnCheckedChangeListener is executed correctly. I'm completly stunned. Why is the radio button not fully checked? Only thing I can think of is that i'm using Rx2Firebase periodRetriever = FirebaseHelper.getInstance(getContext()).getPeriod() .defaultIfEmpty(0) .distinctUntilChanged() .subscribe(new Consumer<Integer>() { @Override public void accept(

How to nest a RadioGroup with dynamic lists of RadioButton inside each row/item of a RecyclerView

爷,独闯天下 提交于 2019-12-13 08:47:18
问题 I need a layout like this: The Red titles are the first level array from dish_options and the RadioButtons are a populated from an array items inside dish_options of the json: As you may notice the dish_options is an array, which might have many more object inside one of the keys of this dish_options might store an items arrays. I tried using getItemViewType() and set different layouts for first level dish_options (red title) and implemented a different layout for the RadioButton in each row

Android - Get values of Radio Buttons in a ListView

白昼怎懂夜的黑 提交于 2019-12-12 03:38:46
问题 I designed a scenario which, according to my understanding of Java, should have worked out fine but unfortunately didn't. The scenario is explained in code: ListViewAdapter public final class ListViewAdapter extends BaseAdapter { private Context context; private RadioGroup[] radioGroups; private List<String> listOfData; public OneForAllListViewAdapter(Context context, List<String> listOfData) { super(); this.context = context; this.radioGroups = new RadioGroup[listOfData.size()]; this

dynamic radio buttons are not working when click the radio group to checkchangelistner

﹥>﹥吖頭↗ 提交于 2019-12-12 02:58:23
问题 I created the radio buttons dynamically and set them in the radio group and it is working good but when i click the radio buttons to get the value but onclick is not working here is the code: in this when i click on checked change listner there is nothing happens i also taost it to show either onclick is working or not but nothing prints. please help thanks in advance. try { Thread.sleep(1000); voterNA=dbcon.GetVoterNA(id); LinearLayout ll=new LinearLayout(context); ll.setOrientation

Android requestfocus on unchecked radiogroup and show error beside each unchecked radiogroup

非 Y 不嫁゛ 提交于 2019-12-11 17:39:29
问题 I have set onclick event on a button(Submit). If the radio buttons of a radio group is not selected then I try to Toast message and focus/listview scroll the first unchecked radio group with error image beside or text(please select answer) as well as show error beside all unchecked radiogroup. I was able to achieve Toast message but not able to achieve focus and error beside on radiogroup which is unchecked. **CustomAdapter** public class CustomAdapter extends BaseAdapter { Context context;

uncheck radiobutton/radiogroup on Button click - Android

我的未来我决定 提交于 2019-12-11 15:22:21
问题 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 my listview and generating each listview using a custom adapter. Here is my code: Mainactivity public class MainActivity extends AppCompatActivity { private ListView simpleListView; private CustomAdapter customAdapter; private String[] questions;