Try this way
public void onBackPressed()
{
if(brand.isCursorVisible()){
brand.setCursorVisible(false);
brand.clearFocus();
}else{
super.onBackPressed();
}
}