RadioGroupDemo
btn_Group = (RadioGroup) findViewById(R.id.friut); btn_apple = (RadioButton) findViewById(R.id.apple); btn_banana = (RadioButton) findViewById(R.id.banana); btn_peach = (RadioButton) findViewById(R.id.peach); Title = (TextView) findViewById(R.id.text); Result = (TextView) findViewById(R.id.result); btn_Group.setOnCheckedChangeListener(new OnCheckedChangeListener() { public void onCheckedChanged(RadioGroup group, int checkedId) { // TODO Auto-generated method stub // int id=group.getCheckedRadioButtonId(); switch(checkedId){ case R.id.apple: Result.setText("你选择的是"+btn_apple.getText()); break; case R.id.banana: Result.setText("你选择的是"+btn_banana.getText()); break; case R.id.peach: Result.setText("你选择的是"+btn_peach.getText()); break; } } });
- 1
- qaz5473779022014-03-23简单了解(RadioGroup) 组件。
- 粉丝: 0
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 单家独院式农房户型设计110平-t3.dwg
- 有了DevExpress VCL 23.2.6 Full Source 这个版本源码,怎么能没有相应的Demo呢
- GIN+SCUI企业级后台管理系统;后端基于go语言开发,前端基于vue3开发的scui框架
- 单家独院式图纸110平方米户型水电图.dwg
- aardio - 阿里云mqtt实例
- 基于python后端开发框架
- seata-server 1.4.0和2.0.0
- signal-and-system信号与系统
- career.it.signals-systems信号与系统
- 基于TCP-IP实现的斗地主游戏(ARM-LINUX)C源码-95分以上课程设计