0

We're making an app that can make surveys which is to be answered, of course.

But i'm not sure if it is possible that, for example, we will display all the list of inserted survey topics

and that in every topic, there'll be 1 button for each, generated individually ( sorry for the term. not really good in English. ) so that they can select it.

I'm also hoping to use it in the list of questions so that they can select from given answers using those buttons.

If it is possible, can you please give me some hints/starting lines how to make it?

Thanks in advance.

Randomizer
  • 131
  • 8

1 Answers1

0

I think you need to overview ListView widget of Android first. It helps to show lists you want.

And after you need to research Adapter you need. It is interface you must implement to use with ListView.

busylee
  • 2,540
  • 1
  • 16
  • 35
  • I forgot to mention that I already displayed the data by using the ListView. What's the next thing I should do? – Randomizer Jul 07 '14 at 05:34
  • Can you describe more clearly what do you need to show? i am not sure I understand right.. You need to show list, each element has button, and you want to programmatically generate this button? – busylee Jul 07 '14 at 05:47
  • Yup. Each item in the ListView should atleast generate buttons, 'programmatically' (as you described). – Randomizer Jul 07 '14 at 05:50
  • If you need to generate `Button` programmatically. You can add new view (`Button` extends `View`) and add it to layout of your list item. You can read this question for more information http://stackoverflow.com/questions/2395769/how-to-programmatically-add-views-to-views Hope it helps. – busylee Jul 07 '14 at 05:59
  • Should I drag-and-drop a 'button' from the palette or just code it in the XML? Sorry for asking. Really bad when it comes to XMLs.\ – Randomizer Jul 07 '14 at 06:01
  • It is not really important in what way you whant to describe xml file for your list item. Result is equal. I have described programmatically creating view. It is not both you mentioned. – busylee Jul 07 '14 at 06:03