Example usage for android.widget EditText getText

List of usage examples for android.widget EditText getText

Introduction

In this page you can find the example usage for android.widget EditText getText.

Prototype

@Override
    public Editable getText() 

Source Link

Usage

From source file:Main.java

/**
 * check EditText is empty or not/*from  ww  w.j  a v a2s . c o m*/
 *
 * @param edText pass EditText for check is empty or not
 * @return true or false
 */
public static boolean isEmptyEditText(EditText edText) {
    return edText.getText().toString().trim().length() <= 0;
}

From source file:Main.java

/**
 * helper used to get text from EditText
 *
 * @param editText - consumes an EditText
 * @return- the stripped string of its contents
 *//*from  w  ww. ja  v  a 2 s.  c  o  m*/
public static String getText(EditText editText) {
    return editText.getText().toString().trim();
}

From source file:Main.java

/**
 * Gets the text from an EditText./*from  ww w .ja v a2 s.  c  om*/
 * @return The text from the given EditText or the empty string, if no text is set.
 */
static String getNullCheckedText(final EditText text) {
    return text.getText() == null ? "" : text.getText().toString();
}

From source file:Main.java

/**
 * check EditText is empty or not//www .j a  va 2  s  .c o  m
 *
 * @param edText pass EditText for check is empty or not
 * @return true or false
 */
public static boolean isEmptyEditText(EditText edText) {
    if (edText.getText().toString().trim().length() > 0)
        return false;
    else
        return true;
}

From source file:Main.java

public static String getString(EditText et) {
    return et.getText().toString().trim();
}

From source file:Main.java

public static void setSeletionEnd(EditText editText) {
    editText.setSelection(editText.getText().length());
}

From source file:Main.java

public static boolean isNull(EditText editText) {
    String text = editText.getText().toString().trim();
    if (text != null && text.length() > 0) {
        return false;
    }/* w  ww  . j  av  a 2  s  . c  o  m*/
    return true;
}

From source file:Main.java

public static boolean validarCadastro(EditText[] array) {
    boolean retorno = true;
    for (EditText et : array) {
        if (et.getText().toString().equals("")) {
            retorno = false;//  w w  w  . j av  a2  s.  c  om
            break;
        }
    }
    return retorno;
}

From source file:Main.java

public static void pushCursorToEnd(boolean isFocussed, EditText editText) {
    if (isFocussed && editText.getText().length() > 0) {
        String text = editText.getText().toString();
        editText.setText("");
        editText.append(text);/*from  www  .  j  a va  2  s .  co m*/
    }
}

From source file:Main.java

public static boolean isZero(EditText input) {
    if (Double.parseDouble(input.getText().toString()) == 0) {
        return true;
    }//from  w w w .  j  av  a  2 s  .  co m
    return false;
}