dies wird Ihnen helfen, ...
in xml
<RadioGroup
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="left"
android:layout_margin="25dp"
android:background="#FF0"
android:paddingRight="50dp"
>
<RadioButton
android:id="@+id/Radio_Windows_Phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Windows Phone 7 Silverlight Cookbook"
android:onClick="onRadioButtonClicked"
/>
<RadioButton
android:id="@+id/Radio_IOS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Swift Development with Cocoa"
android:onClick="onRadioButtonClicked"
/>
in java
public void onRadioButtonClicked(View v)
{
//require to import the RadioButton class
RadioButton rb1 = (RadioButton) findViewById(R.id.Radio_one);
RadioButton rb2 = (RadioButton) findViewById(R.id.Radio_two);
//is the current radio button now checked?
boolean checked = ((RadioButton) v).isChecked();
//now check which radio button is selected
//android switch statement
switch(v.getId()){
case R.id.Radio_one:
if(checked)
//if first selected
break;
case R.id.Radio_two:
if(checked)
//if second selected
break;
}