因为下载的直接是最新版本的robotium4.1版,这次碰到gridView问题时,发现网上有getCurrentListViews() 、getCurrentImageViews()等方法。而自己却没有,纳闷了,下载查看了下3.6版本,果然有。

3.6版本中的方法:

 ArrayList<android.widget.Button> getCurrentButtons() 
          Returns an ArrayList of the Button objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.CheckBox> getCurrentCheckBoxes() 
          Returns an ArrayList of the CheckBox objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.DatePicker> getCurrentDatePickers() 
          Returns an ArrayList of the DatePicker objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.EditText> getCurrentEditTexts() 
          Returns an ArrayList of the EditText objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.GridView> getCurrentGridViews() 
          Returns an ArrayList of the GridView objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.ImageButton> getCurrentImageButtons() 
          Returns an ArrayList of the ImageButton objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.ImageView> getCurrentImageViews() 
          Returns an ArrayList of the ImageView objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.ImageView> getCurrentImageViews(android.view.View parent) 
          Returns an ArrayList of the ImageView objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.ListView> getCurrentListViews() 
          Returns an ArrayList of the ListView objects currently shown in the focused Activity or Dialog.
<T extends android.widget.LinearLayout> 
ArrayList<T>
getCurrentNumberPickers() 
          Returns an ArrayList of the NumberPicker objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.ProgressBar> getCurrentProgressBars() 
          Returns an ArrayList of the ProgressBar objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.RadioButton> getCurrentRadioButtons() 
          Returns an ArrayList of the RadioButton objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.ScrollView> getCurrentScrollViews() 
          Returns an ArrayList of the ScrollView objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.SlidingDrawer> getCurrentSlidingDrawers() 
          Returns an ArrayList of the SlidingDrawer objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.Spinner> getCurrentSpinners() 
          Returns an ArrayList of the Spinner objects (drop-down menus) currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.TextView> getCurrentTextViews(android.view.View parent) 
          Returns an ArrayList of the TextView objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.TimePicker> getCurrentTimePickers() 
          Returns an ArrayList of the TimePicker objects currently shown in the focused Activity or Dialog.
 ArrayList<android.widget.ToggleButton> getCurrentToggleButtons() 
          Returns an ArrayList of the ToggleButton objects currently shown in the focused Activity or Dialog.
 ArrayList<android.view.View> getCurrentViews() 
          Returns an ArrayList of the View objects currently shown in the focused Activity or Dialog.

再仔细看了下4.0中的方法:

 java.util.ArrayList<android.view.View> getCurrentViews() 
          Returns an ArrayList of the Views currently displayed in the focused Activity or Dialog.
<T extends android.view.View> 
java.util.ArrayList<T>
getCurrentViews(java.lang.Class<T> classToFilterBy) 
          Returns an ArrayList of Views matching the specified class located in the focused Activity or Dialog.
<T extends android.view.View> 
java.util.ArrayList<T>
getCurrentViews(java.lang.Class<T> classToFilterBy, android.view.View parent) 
          Returns an ArrayList of Views matching the specified class located under the specified parent.

虽然只剩下了三个getCurrentViews()方法,但却可以替代3.6的众多方法

java.lang.Class<T> classToFilterBy参数传入相应的类即可

例如:ArrayList<ImageView> imageList=solo.getCurrentViews(ImageView.class);得到的即是ImageView

ArrayList<ImageView> imageList=solo.getCurrentViews(ImageView.class,parentView);

robotium3.6与4.0以后的区别相关推荐

  1. 浅谈JQuery中$('.classname').get(0); $('.classname').eq(0); $('.classname')[0]三者的区别

    举例浅谈JQuery中$('.classname').get(0); $('.classname').eq(0); $('.classname')[0]三者的区别 demo Dom结构: <di ...

  2. iBatis 2.x 和 MyBatis 3.0.x 的区别

    简介: 本文主要讲述了 iBatis 2.x 和 MyBatis 3.0.x 的区别,以及从 iBatis 向 MyBatis 移植时需要注意的地方.通过对本文的学习,读者基本能够了解 MyBatis ...

  3. EbN0、SNR、0.1nmOSNR的区别与联系

    文章目录 前言 一.SNR与EbN0 二.0.1nmOSNR 1.波长宽度与带宽的换算 2.0.1nmOSNR 2.1.单极化信号 2.2.双极化信号 总结 前言 无论是无线通信.光通信或者可见光通信 ...

  4. ‘\0’ ,‘0’, “0” ,0之间的区别

    看来基础还是很重要的,基础不扎实就难以学好c语言,就别说写出高质量的c语言代码了.今天,我就被这个问题折磨的不行了,哈哈,不过现在终于明白了'\0' ,'0', "0" 之间的区别 ...

  5. 连接MYSQL时,主机名为 localhost 和 127.0.0.1 的区别

    连接MYSQL时,主机名为 localhost 和 127.0.0.1 的区别 1.localhost也叫local ,正确的解释是:本地服务器,localhot(local)是不经网卡传输!这点很重 ...

  6. USB3.0和2.0有什么区别 --旧时光 oldtimeblog

    如今USB3.0数据接口正变得越来越流行,新推出的笔记本基本会拥有多个USB3.0就口,就连IVY新一代处理器岁对用的B75.Z77等新主板相比SNB平台主板的很大不同也是在于B75.Z77等主板新增 ...

  7. 创建VUE项目,vue-cli2.0版本和3.0版本的区别,将vue2.0项目升级为vue3.0项目

    创建VUE项目,vue-cli2.0版本和3.0版本的区别,将vue2.0项目升级为vue3.0项目 使用vue-cli2.0版本创建vue项目 创建前的准备 开始创建 创建过程 项目正常创建 使用v ...

  8. Keras vs. tf.keras: 在TensorFlow 2.0中有什么区别?

    在本教程中,您将发现Keras和tf.keras之间的区别,包括TensorFlow 2.0中的新增功能. Keras vs. tf.keras: 在TensorFlow 2.0中有什么区别? htt ...

  9. 深入理解c语言——‘\0’ ,‘0’, “0” ,0之间的区别

    看来基础还是很重要的,基础不扎实就难以学好c语言,就别说写出高质量的c语言代码了.今天,我就被这个问题折磨的不行了,哈哈,不过现在终于明白了'\0' ,'0', "0" 之间的区别 ...

  10. mysql localhost和127.0.0.1的区别

    转自:http://hi.baidu.com/qicaiqinxian/blog/item/c510f35066b73b531138c221.html localhost与127.0.0.1的区别是什 ...

最新文章

  1. oracle 查询本周数据生成下周数据
  2. docker容器运行mysql持久化_docker容器实现数据持久化的两种方式及其区别
  3. 5M1E,软件质量管理最佳解决方案
  4. PHP读取数据库表显示到前台
  5. java autovalue_Android AutoValue使用和扩展库
  6. rest_framework09:自动生成接口文档(简略)
  7. java进程和线程_Java™ 教程(进程和线程)
  8. jQuery中 index() 方法的使用
  9. Mysql 里的约束
  10. android 屏幕方向改变 重新测量,android – 扫描时自动更改屏幕方向(使用ZXING库)...
  11. Day11 JaseSE File类的使用
  12. 公众号开发:实现一键复制功能
  13. 解决uni-app小程序获取路由及路由参数
  14. 【算法】算法之会议安排问题(C++源码)
  15. 如何搭建一个自己的私有云盘
  16. x是小于9的非负数的matlab,x是小于10的非负数”,用MATLAB表达式可写为
  17. 蓝桥杯——六面体染色
  18. 移动高德地图marker点
  19. access 套用表格_Word表格编辑技巧:在Word中使用Access的数据-word技巧-电脑技巧收藏家...
  20. p37 p38 p39 p40 p41

热门文章

  1. 知识竞赛抢答器PLC设计
  2. 二年级上册计算题_二年级上册数学计算题
  3. Android关机充电编译,Android6.0+关机状态下实现充电自动开机
  4. hutool工具私人学习笔记
  5. 迷你屏+OLED好屏:个性专业两手抓 华硕灵耀X 14专业好屏体验
  6. 多摩川绝对值编码器STM32F103通信源码 通信实现源码及硬件实现方案,用于伺服行业开发者开发编码器接口,对于使用STM32开发电流环的人员具有参考价值
  7. 豆瓣Top250:Python爬虫+数据可视化
  8. CryptoJS加密使用
  9. 计算机串口程序配置,串口设置软件 串口调试工具如何使用
  10. Redis的集群原理