再仔细看了下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);

 
移动端测试

再仔细看了下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);

相关文章:

  • 2021-09-20
  • 2021-11-13
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2021-07-12
  • 2021-08-10
猜你喜欢
  • 2022-12-23
  • 2021-06-08
  • 2021-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-08-20
  • 2022-12-23
相关资源
相似解决方案