把androidmanifest.xml和main.xml都贴上来看下~

解决方案 »

  1.   

    楼主的代码完全正确,没有任何问题。
    我把楼主的代码拷贝后,自己完善了main.xml后,运行正常。建议楼主重新建一个工程试试。
    我的main.xml如下
    <?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"
        >
    <TextView  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/hello"
        android:id="@+id/text"
        />
        <RadioGroup
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/RadGroup"
        >
        <RadioButton
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="On"
        android:id="@+id/Rad1"
        />
        <RadioButton
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Off"
        android:id="@+id/Rad2"
        />
        </RadioGroup>
    </LinearLayout>