Android examples for java.lang.reflect:Field
check Require EditText Fields
//package com.java2s; import android.widget.EditText; public class Main { public static boolean checkRequireFields(String requiredMessage, EditText... editTexts) {//from w w w.ja v a2 s .co m boolean hasRequired = false; for (EditText editText : editTexts) { String textValue = editText.getText().toString(); if (textValue.trim().isEmpty()) { editText.setError(requiredMessage); hasRequired = true; } } return hasRequired; } }