1

I've created a custom arrayadapter to handle a json response that I'm successfully throwing into a listview. However, I'm unsure of the best way to display radio buttons next to each item... I've read about using android.R.layout.simple_list_item_single_choice as the default view, but I'm using a custom adapter and a custom xml to display my data... so I'm wondering in this case what is the best way to implement radio buttons on a listview? thx

Stokedbits
  • 415
  • 3
  • 10

1 Answers1

2

I think this can help you.

Just change the line

getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

to

getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);

Hope this helps !!

Community
  • 1
  • 1
Prateek Jain
  • 1,214
  • 14
  • 24