Android examples for User Interface:EditText
get EditText Value
/* Copyright 2014 ESRI/*from ww w. ja v a 2 s . c om*/ * * All rights reserved under the copyright laws of the United States * and applicable international laws, treaties, and conventions. * * You may freely redistribute and use this sample code, with or * without modification, provided you include the original copyright * notice and use restrictions. * * See the Sample code usage restrictions document for further information. * */ //package com.java2s; import android.widget.EditText; public class Main { public final static double DEFAULT_DOUBLE_VALUE = Double.NEGATIVE_INFINITY; public static double getEditTextValue(EditText text) { double ret = DEFAULT_DOUBLE_VALUE; String textString = text.getText().toString(); if (textString != null && textString.length() > 0) { ret = Double.parseDouble(textString); } return ret; } }