views:

23

answers:

1

Hi! I am writing a game app for Android, where a question word with four different alternatives will show that the user can choose between.

I have a database and i can insert from the app, but what would be the easiest way to use a select statement, and then parse the response and populate the five different positions in the radio group?

I have done the Notepad tutorial on the dev. site, and it seems a bit too complicated for what i need. At least I cannot decipher it well enough to apply on my project.

Thanks for any help! /AK

A: 

Use a listview and define a custom adapter that will populate the "row" with the five different answers.

Tony G.
The problem is to get the data from the sqlite database. That is prio 1. How should I start? This is what I have now: public Cursor getWords() { return mDb.query(DATABASE_WORDTABLE, new String[] {KEY_WID,KEY_WORD, KEY_ALT1,KEY_ALT2, KEY_ALT3, KEY_ALT4 }, null, null, null, null, null); } How can I use this in the actual activity? And does it look somewhat right? How many nulls should I have?
Anna-Karin
I got it working by putting a listview before the radiobutton group in the xml. But the listview disables the onchanged events, both of the radiobuttons and the regular buttons in the activity. Any idea on why that is?
Anna-Karin