下面列出了android.support.design.widget.TextInputLayout#requestFocus ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private boolean checkInput(TextInputLayout textInputLayout, int errorResId) {
String text = textInputLayout.getEditText().getText().toString();
if (TextUtils.isEmpty(text)) {
textInputLayout.setError(getResources().getString(errorResId));
textInputLayout.requestFocus();
return false;
}
return true;
}
private boolean checkInput(TextInputLayout textInputLayout, int errorResId) {
String text = textInputLayout.getEditText().getText().toString();
if (TextUtils.isEmpty(text)) {
textInputLayout.setError(getResources().getString(errorResId));
textInputLayout.requestFocus();
return false;
}
return true;
}
private boolean checkInput(TextInputLayout textInputLayout, int errorResId) {
String text = textInputLayout.getEditText().getText().toString();
if (TextUtils.isEmpty(text)) {
textInputLayout.setError(getResources().getString(errorResId));
textInputLayout.requestFocus();
return false;
}
return true;
}