开发者

Check existence of a fragment using Robotium - Android

开发者 https://www.devze.com 2023-04-12 18:51 出处:网络
Is anyon开发者_开发技巧e aware of a way to check the existence of fragment using Robotium? Regards

Is anyon开发者_开发技巧e aware of a way to check the existence of fragment using Robotium?

Regards Rc


I'm assuming that you want to find the existence of a fragment that you know the activity or tag for.

first call getCurrentActivity() on Solo and then call

getFragmentManager().findFragmentById()

or

getSupportFragmentManager().findFragmentById()

if you're using the v4 compatibility library. That will search all the fragments on the page and return it. You can also use findFragmentByTag() if you've previously tagged the Fragment.

0

精彩评论

暂无评论...
验证码 换一张
取 消