Java Code Examples for android.widget.TextView.getError()

The following are Jave code examples for showing how to use getError() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: smart-lens   File: CustomMatchers.java   View Source Code Vote up 6 votes
/**
 * Returns a matcher that matches {@link TextView}s based on text property value.
 */
@NonNull
public static Matcher<View> hasError() {

    return new BoundedMatcher<View, TextView>(TextView.class) {

        @Override
        public void describeTo(final Description description) {
            description.appendText("Has error case failed.");
        }

        @Override
        public boolean matchesSafely(final TextView textView) {
            return textView.getError() != null;
        }
    };
}