Java tutorial
//package com.java2s; //License from project: Open Source License import android.widget.EditText; public class Main { /** * Gets the text from an EditText. * @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(); } }