Code example for EditText

Methods: getTextsetError

0
			mHostText.setError("the hostname is not valid");
		} else { 
			mHostText.setError(null);
		} 
 
		if (!Validator.validateInteger(mPortText.getText().toString())) {
			valid = false;
			mPortText.setError("the port is not valid");
		} else { 
			mPortText.setError(null);
		} 
 
		if (!Validator.validateString(mPasswordText.getText().toString())) {
			valid = false;
			mPasswordText.setError("the password is not valid");
		} else { 
			mPasswordText.setError(null);
		} 
 
		if (!valid) {
			alert("Could not send command", "Not sending command, some parameters are invalid.");