The first : main.xml file,RadioButton element add android:checked attribute, set "true";

The second : use setChecked() on the RadioButton from within your onCreate() callback in your activity.example:

RadioButton rb = (RadioButton)findViewById(R.id.radio1);

rb.setChecked(true);

The third:use check() on the RadioGroup from within your onCreate() callback in your activity.example:

RadioGroup rg = (RadioGroup)findViewById(R.id.radiogroup);

rg.check(R.id.radio2);

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android编译系统(一、环境与命令)
  2. 手机应用开发 第二节:PhoneGap and Dojo M
  3. android ------实现高德定位并获取相应信
  4. android中activity的四种加载模式
  5. App与Js交互(二)Android
  6. Android上使用ksoap2支持Web Service服务
  7. Android(安卓)中LayoutInflater(布局加载
  8. android读写assets目录下面的资源文件(文
  9. Android(安卓)笔记 01
  10. Android(安卓)彻底关闭----退出程序