It is possible to use EditText to provide user feedback. The first method uses myEditText.setError(error) as in:
String destination= editTextPhoneNumber.getText().toString();
// pre conditions
if (destination.length()<7){
editTextPhoneNumber.setError("Invalid Phone #");
editTextPhoneNumber.setText("");
editTextPhoneNumber.requestFocus();
return;
}
Note the call to requestFocus which triggers the error text.
The second method is to use hints as in:
// SMS Receiver
private BroadcastReceiver sentReceiver= new BroadcastReceiver() {
@Override
public void onReceive(Context c, Intent i) {
// TODO Auto-generated method stub
switch(getResultCode()) {
case Activity.RESULT_OK:
editTextPhoneNumber.setHint("Success Sending SMS");
editTextPhoneNumber.setText("");
break;
default:
...
break;
}
}
};
Note the call to setText("") which makes the hint visible.
Be sure to examine the behavior of programatically set errors and hints on a soft kill. Be sure to consider how to reset hints to default values and clear errors on re-entry.