Im new to Android..
How to convert the hashmap values into ArrayList.. My problem is... Now i have a hashmap which contains my all datas(questionid,question,answers with multiple options).
Now what i want to do is...i need to display the question in textview and answers in radiobuttons based upon questionid, And that i have next button which is for display the next question and answers based upon questionid.
So Meanwhile i click on next button i should get increment the questionid and display the question and answers, same as for previous button... Please help me. im new to android..thanks a lot in advance...
hashmap
String questionid = c.getString(TAG_QUESID);
String question = c.getString(TAG_QUES);
String answer = c.getString(TAG_ANSW);
HashMap<String, String> map = new HashMap<String, String>();
map.put(TAG_QUESID, questionid);
map.put(TAG_QUES, question);
map.put(TAG_ANSW, answer);
System.out.println("QuestionIDMap:"+map);
Layout
<TextView
android:id="@+id/que_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="59dp"
android:layout_marginTop="36dp"
android:text="TextView" />
<RadioGroup
android:id="@+id/rdgroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/que_txt"
android:layout_marginTop="38dp"
android:orientation="vertical" >
<RadioButton android:id="@+id/RB1" android:text="button1"/>
<RadioButton android:id="@+id/RB2" android:text="button2"/>
<RadioButton android:id="@+id/RB3" android:text="button3"/>
<RadioButton android:id="@+id/RB4" android:text="button4"/>
</RadioGroup>
<TextView
android:id="@+id/rdtxt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/rdgroup"
android:layout_marginTop="38dp"
android:text="Answer: Nothing is picked">
</TextView>
<Button
android:id="@+id/prv_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/nxt_btn"
android:layout_alignParentLeft="true"
android:layout_marginLeft="18dp"
android:text="Previous" />
<Button
android:id="@+id/nxt_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/rdtxt"
android:layout_marginRight="50dp"
android:layout_marginTop="34dp"
android:text="Next" />