Android: Listview Item with Radio Button? -


I have a list view and an associated line view (xml) for that, there are 5 questions in the list and each question is 4 Options are therefore line view xml has defined 4 unique radio buttons (for option) in the text view (for question) and radio group, so as an option there is a single component with option 4 option The list is repeated 5 times. My problem is that how can the particular radio button selected for all 5 questions and its related options on any one event such as: submit button

linked to serious problem, thank you

  public zero on radia button (see view) {// Is the button now checked? Boolean check = ((radio button) view). the inspection (); // Check which radio button was clicked on the switch (see .gateID) {Case RID. Radiobutton 1: If checked (checked) // radio button 1 is selected. break; Case R.id.radiobutton2: If (check) // radio button 2 is selected. break; Case R.id.radiobutton3: If (check) // radio button 3 has been selected. break; Case R.id.radiobutton4: If (check) // radio button 4 has been selected. break; }}   

.

  See public getView (last integer arg0, see arg1, viewgroup arg2) {last seeholder vh; Vh = new viewholder (); If (arg1 == faucet) {arg1 = mInflater.inflate (R.layout.listviewsingleimg, arg2, incorrect); Vh.iv1 = (ImageView) arg1.findViewById (R.id.ivs); Vh.rb = (radio button) arg1.findViewById (R.DiudiBoot1); Vh.tv = (text view) arg1.findViewById (R.id.textView1); } And {arg1.setTag (VH); } Vh.iv1.setImageResource (R.drawable.ic_launcher); Vh.tv.setText ("hello"); Vh.rb.setText ("radiobutton"); Vh.rb.setOnClickListener (New OnClickListener) {public void onClick (see v) {// TODO auto-generated method stub if (arg0 == 1) {switch (v.getId ()) {Case R.id. RadioButton1: If (vh.rb.isChecked ()) // radio button 1 has been selected. Toast.makeText (c, "radiobutton 1 clicked", 1000) .show (); break;}}}}); Return arg1; } Fixed class viewer {Lesson TV; Radiobutton RB; Image view iv1; }   

When the toast displayed above is listed, the review is clicked in position 1 of the review.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -