UiThreadTest

public abstract @interface UiThreadTest
implements Annotation

android.support.test.annotation.UiThreadTest


此注释应与UiThreadTestRule一起使用,或与任何从其继承的规则一起使用。 当注释存在时,测试方法在应用程序的UI线程(或主线程)上执行。

Note, due to current JUnit limitation, methods annotated with Before and After will also be executed on the UI Thread. Consider using runOnUiThread(Runnable) if this is an issue.

也可以看看:

Summary

Inherited methods

From interface java.lang.annotation.Annotation