相关疑难解决方法(0)

使用any()时出错; 在Android测试中需要不兼容的类型:Matcher <View> found:Matcher <Object>

我运行下面的代码并返回任何错误();

error: incompatible types
required: Matcher <View>
found:    Matcher <Object>

/** 
     * Perform action of waiting until UI thread is free. <p/> E.g.: onView(isRoot()).perform(waitUntilIdle());
     * @return
     */
    public static ViewAction waitUntilIdle(){
      return new ViewAction(){
        @Override public Matcher<View> getConstraints(){
          return anything();
        }
        @Override public String getDescription(){
          return "wait until UI thread is free";
        }
        @Override public void perform(    final UiController uiController,    final View view){
          uiController.loopMainThreadUntilIdle();
        }
      }
    ;
    }
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

testing android android-testing android-espresso

3
推荐指数
1
解决办法
650
查看次数