Instrumentation.ActivityMonitor 可以查找任何正在启动的活动吗?
根据Android文档,Instrumentation.ActivityMonitor能够返回正在启动的Activity。也就是说,您在其构造函数中向其传递一个 IntentFilter,以便它知道要查找什么。我的问题是,ActivityMontior 是否可以寻找任何类型的 Activity 启动?换句话说,是否可以使用 ActivityMonitor 返回前台显示的最上面的 Activity?
According to the Android documentation, Instrumentation.ActivityMonitor is able to return an Activity that is being started. That is, you pass it an IntentFilter in its constructor so it knows what it's looking for. My question is, is it possible for ActivityMontior to look for any kind of Activity starting? In other words, is it possible to use ActivityMonitor to return the top most Activity showing on the foreground?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,ActivityMonitor 将等待任何与 IntentFilter 匹配的 Activity,启动时该 Activity 将位于最上面,除非您使用一些标志,例如 FLAG_ACTIVITY_PREVIOUS_IS_TOP 可能会影响此排序。
Yes, ActivityMonitor will wait for any Activity that matches the IntentFilter, which when started will be the top most, unless you are using some flags like FLAG_ACTIVITY_PREVIOUS_IS_TOP that may affect this ordering.