set String to TextView - Android User Interface

Android examples for User Interface:TextView Value

Description

set String to TextView

Demo Code

/*/*from   w w  w . j  a v a2s . co  m*/
 * *
 *  * Copyright 2012 fenbi.com. All rights reserved.
 *  * FENBI.COM PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 */
//package com.java2s;

import android.view.View;

import android.widget.TextView;

public class Main {
    public static TextView setTextView(View parent, int id,
            CharSequence string) {
        TextView t = (TextView) parent.findViewById(id);
        if (t != null) {
            t.setText(string);
        }
        return t;
    }
}

Related Tutorials