null checking edit textbox android
- by sara brown
i want to make empty textbox checking for android. i tried try catch but it was force to close.
below is my codes
try{
name = (EditText)findViewById(R.id.name);
}catch(NullPointerException ex){
new AlertDialog.Builder(KawalanAppXTVT.this).setTitle("Error" )
.setMessage("That's not a number")
.setPositiveButton("OK", null).show();
can someone help me?