android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.21"
android:gravity="center_vertical" >
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="笔记本" />
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="台式机" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="0.54"
android:gravity="center" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定" />
</LinearLayout>
如何实现点击台式机和确定跳转到台式机的界面,点击笔记本和确定跳转到笔记本的界面
https://bbs.csdn.net/topics/390930274
暂且按你的需求,RadioGroup点击有监听事件,在里面用一个参数标记当前是选的笔记本还是台式机,然后在Button的的监听里,判断这参数,切换对于的
界面。
然后 我是在想 有了radio group,为什么要加个button?因为你直接可以在group的监听里做这些事。
希望对你有帮助,可以加我好友,相互进步。
点击监听里面设置一个标志位即可,然后在确定点击事件里面判断该标志位,作相应的处理