@Test()
  public void shouldThrowStaleElementReferenceError() {
    openStartActivity();
    WebElement textfield = driver().findElement(By.id("my_text_field"));
    Assert.assertNotNull("textfield should be found.", textfield);
    driver().findElement(By.id("startUserRegistration")).click();
    new WebDriverWait(driver(), 5).until(ExpectedConditions.presenceOfElementLocated(By
        .id("inputUsername")));

    try {
      textfield.sendKeys("Hello");
      Assert.fail("The element from previous screen should not be found.");
    } catch (StaleElementReferenceException e) {
      // // this element is located on previous activity and should not be found
    }
  }
Element finding test for the native view part of selendroid.

@author ddary
selendroid-test-app/src/test/java/io/selendroid/nativetests/NativeElementFindingTest.java