@Test
  public void testBackgroundAppFunctionality() throws Exception {
    openStartActivity();
    driver().backgroundApp();
    String currentActivity = adbCurrentActivity();
    Assert.assertTrue(currentActivity.contains("com.android.launcher2.Launcher"));
    driver().resumeApp();
    currentActivity = adbCurrentActivity();
    Assert.assertTrue(currentActivity.contains("io.selendroid.testapp.HomeScreenActivity"));
  }
Requires ANDROID_HOME to be set in enviroment.
@throws Exception
selendroid-test-app/src/test/java/io/selendroid/nativetests/BackgroundAppTest.java