set Text for TextView - Android User Interface

Android examples for User Interface:TextView Value

Description

set Text for TextView

Demo Code


//package com.java2s;

import android.view.View;

import android.widget.TextView;

public class Main {
    private static void setText(View convertView, int id, String text) {
        TextView textView = (TextView) convertView.findViewById(id);
        if (textView != null)
            textView.setText(text);//from w  w  w  . j  a v  a2 s. co m
    }
}

Related Tutorials