is EditText Empty - Android User Interface

Android examples for User Interface:EditText

Description

is EditText Empty

Demo Code


//package com.java2s;
import android.widget.EditText;

public class Main {

    public static boolean isEmpty(EditText et) {
        if (et == null) {
            return true;
        }/*from w  w  w. j  a  v  a  2  s  . c  om*/
        if (et.getText().toString().equals("")) {
            return true;
        } else {
            return false;
        }
    }
}

Related Tutorials