Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static int isValidate(String... fields) { if (fields == null) { return 0; } for (int i = 0; i < fields.length; i++) { if (TextUtils.isEmpty(fields[i])) { return i; } } return -1; } }