get TextView Text - Android User Interface

Android examples for User Interface:TextView Value

Description

get TextView Text

Demo Code


//package com.java2s;

import android.view.View;

import android.widget.TextView;

public class Main {
    public static String getTextViewText(View parent, int id) {
        TextView t = (TextView) parent.findViewById(id);
        if (t != null) {
            return t.getText().toString();
        } else {/*www  .ja v a  2s. c  om*/
            return null;
        }
    }
}

Related Tutorials