update TextView - Android User Interface

Android examples for User Interface:TextView

Description

update TextView

Demo Code


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

import android.widget.TextView;

public class Main {
    public static void updateTextView(View view, int id, String text) {
        if (null != view) {
            TextView textView = (TextView) view.findViewById(id);

            if (null != textView)
                textView.setText(text);/*from   ww  w .  j a  va2 s . co  m*/
        }
    }
}

Related Tutorials