Here you can find the source of getDouble(TextView view)
Parameter | Description |
---|---|
view | - the view to read from |
public static Double getDouble(TextView view)
//package com.java2s; import android.widget.TextView; public class Main { /**//from ww w .j av a2s . co m * extract an Double out of a TextView * * @param view - the view to read from * @return the Double value or NULL in case of a non-parseable String */ public static Double getDouble(TextView view) { Double result; if (!isEmpty(view)) { try { result = Double.parseDouble(getString(view)); } catch (Exception e) { result = null; } } else { result = null; } return result; } /** * checks, if the passed TextView contains some text * * @param view - the TextView * @return true, if a non-null, non-blank string is found inside of the text view */ public static boolean isEmpty(TextView view) { if (view != null && view.getText() != null) { return getString(view).length() == 0; } return false; } /** * extract the trimmed string value out of the passed TextView * * @param view - the view to read from * @return the trimmed string value from the view */ public static String getString(TextView view) { return view.getText().toString().trim(); } }