I currently have an Android project with a relative layout.
I want to let the user set one option (out of a pretty long list).
After looking around, I noticed the possibility of using Radio Buttons and displaying them in a Dialog, as described here.
But I read on the API that radio buttons need to be used in the linear layout.
Is there another way of letting a user select something from a list? For instance a sort of select list?
Thanks for any assistance. I have added my current layout for clarification.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFCC" >
<Button
android:id="@+id/buttonExit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Exit" />
<Button
android:id="@+id/buttonStart"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="52dp"
android:text="Play" />
<Button
android:id="@+id/buttonStop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/buttonStart"
android:layout_marginTop="21dp"
android:text="Pause" />
<Button
android:id="@+id/Continue"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/buttonStop"
android:layout_marginTop="16dp"
android:text="Continue" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/Continue"
android:layout_centerHorizontal="true"
android:layout_marginTop="36dp"
android:text="Ready."
tools:context=".MainActivity" />
</RelativeLayout>
You could use a Spinner or a ListView.
You can find info and examples here:
http://developer.android.com/guide/topics/ui/controls/spinner.html