Java tutorial
//package com.java2s; import android.text.TextUtils; import android.widget.EditText; public class Main { public static boolean isNotNull(EditText txt) { if (txt == null) { return false; } String v = txt.getText().toString().trim(); return !TextUtils.isEmpty(v); } }