get TextView As String - Android User Interface

Android examples for User Interface:TextView Value

Description

get TextView As String

Demo Code


//package com.java2s;
import android.view.View;

import android.widget.TextView;

public class Main {
    public static final String getTextAsString(TextView view) {
        return view.getText().toString();
    }/*w  w  w .j  av  a2 s  .c o m*/

    public static final String getTextAsString(View parent, int view) {
        return getTextAsString((TextView) parent.findViewById(view));
    }
}

Related Tutorials