IT人员测试应用:

效果图:

布局设置三个文本框和两个RadioGroup

<TextViewandroid:id="@+id/myTextView"android:layout_width="228px"android:layout_height="49px"android:text="测试结果"android:textSize="15sp"/>
<TextViewandroid:id="@+id/t1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="你了解windows操作系统吗"/><RadioGroupandroid:id="@+id/myRadioGroup"android:layout_width="137px"android:layout_height="216px"android:orientation="vertical"><RadioButtonandroid:id="@+id/myRadioButton1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="精通"/><RadioButtonandroid:id="@+id/myRadioButton2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="一般"/><RadioButtonandroid:id="@+id/myRadioButton3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="陌生"/>
</RadioGroup><TextViewandroid:id="@+id/t2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="你了解编程语言吗"/><RadioGroupandroid:id="@+id/myRadioGroup2"android:layout_width="137px"android:layout_height="216px"android:orientation="vertical"><RadioButtonandroid:id="@+id/myRadioButton21"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="精通各种语言"/><RadioButtonandroid:id="@+id/myRadioButton22"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="了解c语言"/><RadioButtonandroid:id="@+id/myRadioButton23"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="只会说汉语"/>
</RadioGroup>

设置好对象,最后利用if条件判断选项得出结果

package com.example.it;import android.app.Activity;
import android.os.Bundle;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;public class MainActivity extends Activity {public TextView mTextView1;public RadioGroup mRadioGroup1,mRadioGroup2;public RadioButton mRadio1, mRadio2, mRadio3, mRadio4, mRadio5, mRadio6;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// 取得 TextView、RadioGroup、RadioButton对象mTextView1 = (TextView) findViewById(R.id.myTextView);mRadioGroup1 = (RadioGroup) findViewById(R.id.myRadioGroup);mRadioGroup2 = (RadioGroup) findViewById(R.id.myRadioGroup2);mRadio1 = (RadioButton) findViewById(R.id.myRadioButton1);mRadio2 = (RadioButton) findViewById(R.id.myRadioButton2);mRadio3 = (RadioButton) findViewById(R.id.myRadioButton3);mRadio4 = (RadioButton) findViewById(R.id.myRadioButton1);mRadio5 = (RadioButton) findViewById(R.id.myRadioButton2);mRadio6 = (RadioButton) findViewById(R.id.myRadioButton3);// RadioGroup用OnCheckedChangeListener来运行mRadioGroup1.setOnCheckedChangeListener(mChangeRadio);}private RadioGroup.OnCheckedChangeListener mChangeRadio = new RadioGroup.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(RadioGroup group, int checkedId) {// TODO Auto-generated method stubif (checkedId == mRadio1.getId()&&checkedId == mRadio4.getId()) {mTextView1.setText("您是IT达人");} else  {mTextView1.setText("您不是IT达人");}}};
}

Android开发模拟测试题相关推荐

  1. Android开发权威指南(第2版)新书发布

    <Android 开发权威指南(第二版)>是畅销书<Android开发权威指南>的升级版,内容更新超过80%,是一本全面介绍Android应用开发的专著,拥有45 章精彩内容供 ...

  2. FlashDevelop Android开发.md

    2019独角兽企业重金招聘Python工程师标准>>> FlashDevelop Android 开发 > author: gwang(wanggangzero@qq.com) ...

  3. android怎么模拟返回,Android中障蔽返回键,HOME键以及模拟HOME键返回效果的方法...

    Android中屏蔽返回键,HOME键以及模拟HOME键返回效果的方法 在Android开发中,有时需要屏蔽一些实体的按键,如HOME键,返回键等实体的按键,实现的方法如下. 1. 屏蔽实体按键 屏蔽 ...

  4. 提升Android开发效率的最佳实践

    本文属于Android入门与最佳实践系列,有兴趣的可以围观笔者的前一篇关于Android实践建议的文章:2016里一些Android最佳实践列表--Opinionated 原文地址 软件工程师的工作效 ...

  5. android api版本 闪退_经验分享:从事 Android 开发六年,我学到的那些事

    你的代码质量应该随着经验的增加而提高,在本文作者基于 Android 开发者六年间,其都学到了什么? 以下为译文: 六年来,我为多家公司编写过各种应用程序.你编写代码或处理代码库的文化和方式会随着你的 ...

  6. Android开发中使用七牛云存储进行图片上传下载

    Android开发中的图片存储本来就是比较耗时耗地的事情,而使用第三方的七牛云,便可以很好的解决这些后顾之忧,最近我也是在学习七牛的SDK,将使用过程在这记录下来,方便以后使用. 先说一下七牛云的存储 ...

  7. Android开发之通过接口回调机制加载数据(源代码分享)

    Android开发之通过接口回调机制加载数据的简单实现,在实际开发中通过callback方法得到网络加载的数据的使用频率远比通过直接开启线程或异步任务加载数据的频率高的多,这篇文章的代码将简单实现该机 ...

  8. Android开发高手课笔记--如何打造高质量应用?

    前言 学习<Android开发高手课>也有一段时间了,确实对技术的提高很有帮助,可以开拓自己的视野.想利用这一段时间好好整理下学习笔记,以便回顾.由于版权问题,后续笔记不再公开,感兴趣可扫 ...

  9. 高级Android开发面试汇总

    高级 Android 开发面试题汇总 一. Android 基础 1. Service 的两种启动方式 简单的来说就是 直接启动 和 绑定启动 两种方式. // 直接启动 Context.startS ...

最新文章

  1. 从限流削峰到性能优化,谈1号店抽奖系统架构实践
  2. Java面向对象(二)面向对象的特征 --- 封装 、 继承、 多态
  3. P2782 友好城市
  4. 学成在线--9.页面静态化
  5. ACM MM2021 | 腾讯优图实验室9篇论文入选,含弱监督图像描述及定位、表格结构识别等研究方向...
  6. oracle外表日期,三步教会你掌握oracle外表(external table)
  7. 数百万的 Android 手机预装了危险的恶意软件!
  8. Ubuntu14.04上安装CSI tool
  9. 单循环赛积分至少多少才能保证一定出线?
  10. hive和presto计算日期时间差
  11. 2021年茶艺师(初级)考试技巧及茶艺师(初级)试题及解析
  12. AirSim在Windows下环境搭建
  13. OpenCV实战——文本检测
  14. ”Could not find tag for codec none in stream #0, codec not currently supported in container”的解决方法
  15. goss - 一个简洁的 golang 对象存储库
  16. 一文理解UART通信
  17. 配置永久systemd日志
  18. 从微软到谷歌,应届计算机毕业生的2012求职之路
  19. (2,1,2)卷积码BCJR译码matlab仿真
  20. Gps车辆监控软件平台开发技术精华

热门文章

  1. nchome目录介绍
  2. 过去的2016,期待的2017,我与北京继续相伴。
  3. 北京安全员A证怎么考多选题库
  4. MOSFET SOA評估與Tj溫度的計算
  5. AntiSamy:防 XSS 攻击的一种解决方案使用教程
  6. 深入理解Oracle直方图
  7. vue当中实现悬浮球可拖拽
  8. MATLAB基本使用方法(数据类型、基本函数、运算符)
  9. SU2 多段翼型的计算结果
  10. Hyper-v 新建 Windows 虚拟机卡在“Press any key to boot from CD or DVD...,最终显示 No Operating System was Loaded