How to check if an application got closed and returned to device application list using robotium?

0
0

Is there any way to check whether an android application got closed and returned to device application list using robotium?

  • You must to post comments
0
0

There is no direct way, however two ideas came to my mind.
First:

private boolean isApplicationClosed() {
return solo.getCurrentViews().size() == 0;
}

Second (this may affect your application):

private boolean isApplicationClosed() {
try {
solo
.clickOnScreen(100, 100);
} catch (AssertionFailedError e) {
if("Click can not be completed!".equals(e.getMessage().trim()) {
return true;
}
}
return false;
}
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website