private void checkempForm() {
EditText[] allFields = { field1_txt, field2_txt, field3_txt, field4_txt};
List<EditText> ErrorFields =new ArrayList<EditText>();//empty Edit text arraylist
for(EditText edit : allFields){
if(TextUtils.isEmpty(edit.getText())){
// EditText was empty
ErrorFields.add(edit);//add empty Edittext only in this ArayList
for(int i = 0; i < ErrorFields.size(); i++)
{
EditText currentField = ErrorFields.get(i);
currentField.setError("this field required");
currentField.requestFocus();
}
}
}