Android TextView Set setText(TextView tv, int str)

Here you can find the source of setText(TextView tv, int str)

Description

set Text

Declaration

public static void setText(TextView tv, int str) 

Method Source Code

//package com.java2s;

import android.widget.TextView;

public class Main {

    public static void setText(TextView tv, String str) {
        if (tv == null) {
            return;
        }/*w  w w .  j  a va  2  s  .  c om*/
        tv.setText(checkStr(str));
    }

    public static void setText(TextView tv, int str) {
        if (tv == null) {
            return;
        }
        tv.setText(str + "");
    }

    public static String checkStr(String str) {
        if (str != null && !str.equals("")) {
            return str;
        } else {
            return "";
        }
    }
}

Related

  1. setText(TextView tv, String str)
  2. setHtml(TextView view, String html)
  3. setHtml(Activity activity, View parent, int elementId, int resId)
  4. initDate(TextView view,int days)
  5. setBold(TextView tv)