Here you can find the source of setText(TextView tv, String str)
public static void setText(TextView tv, String str)
//package com.java2s; import android.widget.TextView; public class Main { public static void setText(TextView tv, String str) { if (tv == null) { return; }/*ww w . j a va2 s . c o m*/ 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 ""; } } }