Android examples for User Interface:TextView Value
get Int From TextView Safe
//package com.java2s; import android.widget.TextView; public class Main { public static int getIntFromTextViewSafe(TextView view) { if (view.getText() == null || view.getText().toString().isEmpty()) { return 0; }// w w w .ja va 2 s .co m return Integer.parseInt(view.getText().toString()); } }