I m using RadioGroup and RadioButton in my UI.
I am displaying 5 radio buttons and want to selecet one.
I get the UI and I m diplaying five levels for my game.
I am not sure that how can I read that back in the program?
Means if user select first radio button, I want to change the level value = 1,
but if user selects second radio button, I want that value = 2.
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="@drawable/backplane"
- >
- <RadioGroup
- android:id="@+id/selectlevelgroup"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <RadioButton
- android:text = "Level 1"
- android:id = "@+id/level1"
- >
- </RadioButton>
- <RadioButton
- android:text = "Level 2"
- android:id = "@+id/level2"
- >
- </RadioButton>
- <RadioButton
- android:text = "Level 3"
- android:id = "@+id/level3"
- >
- </RadioButton>
- <RadioButton
- android:text = "Level 4"
- android:id = "@+id/level4"
- >
- </RadioButton>
- <RadioButton
- android:text = "Level 5"
- android:id = "@+id/level5"
- >
- </RadioButton>
- </RadioGroup>
- </LinearLayout>
Parsed in 0.004 seconds, using GeSHi 1.0.8.4
And also,
if user makes one selection and changes after that, does the assinment
chages dynamically?
Thanks,
Mitul Modi

