set Text In View - Android User Interface

Android examples for User Interface:TextView Value

Description

set Text In View

Demo Code


//package com.java2s;

import android.app.Activity;

import android.widget.TextView;

public class Main {
    public static void setTextInView(int viewId, String val,
            Activity activity) {/*  www . j  a va  2s. c  o  m*/
        TextView textView = (TextView) activity.findViewById(viewId);
        if (textView != null)
            textView.setText(val);
    }
}

Related Tutorials