关于 getCurrentActivity() 延迟的 android robotium

标签 android robotium

当我开始这样的 Activity 时 solo.click(sth),

然后我参加了一项新 Activity 。但是当我运行 solo.getCurrentActivity() 时,返回的消息实际上不是当前消息。是前者。

但是,当我输入 solo.getview(blablabla),然后运行 ​​solo.getCurrentActivity() 时,它再次工作。我想这是等待的问题,但我只是不知道如何解决。我已经尝试过 waitForActivity() 和类似的东西,但效果不是很好。

有人有什么建议吗?

最佳答案

几天后我终于找到了答案。 solo.getCurrentActivity(yourAct,time) 有效。现在比以前安全多了。

关于关于 getCurrentActivity() 延迟的 android robotium,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30603989/

相关文章:

android - 使用 RelativeLayout 添加页脚时出现问题

android - 尝试使用共享代码隐藏操作栏时出现问题

android - "Test failed to run to completion. Reason: ' 运行多个测试用例时由于 'Process crashed.' 导致仪器运行失败

java - Robotium - 在项目 'androidTest' 中找不到任务 ':APPName'

android - 向eclipse添加jar文档

Android:mp4 H.264 - 不支持基带

java - 小组回合制游戏

android - 从资源创建文件对象

android - 使用 Robotium 检查 fragment 是否存在 - Android

android - 启动 Activity 时出现错误 "could not find class ' android.support.v4.app.FragmentActivity'