[Need Help] Clear the text field is not working properly?

Hey when i am trying to clear a text field in an application, Some time am able to clear the filed and some times it is showing error as Element cant be find.

driver.findElement(By.id(“android:id/checkbox”)).click();
Thread.sleep(5000);
driver.findElement(By.name(“App Server”)).click();
Thread.sleep(3000);
driver.findElement(By.id(“android:id/edit”)).clear();

Can any one help me out with this issue?