Android examples for User Interface:EditText
get Double From EditText
//package com.java2s; import android.widget.EditText; public class Main { private static final Integer ZERO = 0; public static Double getDoubleFrom(EditText editText) { String stringValueFromEditText = getStringFrom(editText); return stringValueFromEditText.isEmpty() ? ZERO : Double .valueOf(stringValueFromEditText); }/* ww w. j av a 2s .co m*/ public static String getStringFrom(EditText editText) { return editText.getText().toString(); } }