IntentStubber

public interface IntentStubber

android.support.test.runner.intent.IntentStubber
Known Indirect Subclasses


拦截活动启动的界面 Intent和存根 Instrumentation.ActivityResult其响应。

通过 IntentStubberRegistry检索stubber的实例

Stubbing意图需要Instrumentation的支持,因此不要期望任何一个实例在任何仪器下出现。

Summary

Public methods

abstract Instrumentation.ActivityResult getActivityResultForIntent(Intent intent)

如果测试作者设置存根结果,则返回给定活动的第一个匹配存根结果。

Public methods

getActivityResultForIntent

Instrumentation.ActivityResult getActivityResultForIntent (Intent intent)

如果测试作者设置存根结果,则返回给定活动的第一个匹配存根结果。 该方法按照它们输入的相反顺序搜索现有的匹配器/响应对列表; 即最后一个存根具有最高的优先权。 如果没有找到匹配给定意图的null结果,则返回null

必须在主线程中调用。

Parameters
intent Intent
Returns
Instrumentation.ActivityResult