validate Feed Fields via TextInputLayout - Android java.lang.reflect

Android examples for java.lang.reflect:Field

Description

validate Feed Fields via TextInputLayout

Demo Code


import android.support.design.widget.TextInputLayout;

public class Main{
    public static boolean validateFeedFields(String feedName,
            TextInputLayout feedNameWrapper, String feedUrl,
            TextInputLayout feelUrlWrapper) {
        boolean isValid = true;

        if (feedName.trim().length() == 0) {
            feedNameWrapper.setError("Enter feed name please");
            isValid = false;/*from  w w  w .  j av  a 2  s  . c om*/
        }
        if (feedUrl.trim().length() == 0) {
            feelUrlWrapper.setError("Enter feed address please");
            isValid = false;
        }

        return isValid;
    }
}

Related Tutorials