I have an EditText in android for users to input their AGE. It is set an inputType=phone. I would like to know if there is a way to check if this EditText is null>
Try this. This is the only solution I got
String phone; try{ phone=(EditText) findViewByID(R.id.age)).getText().toString(); } catch(NumberFormatException e){ Toast.makeText(MainActivity.this, "plz enterphone Number ", Toast.LENGTH_SHORT).show(); return; }