Java tutorial
//package com.java2s; import android.widget.TextView; public class Main { public static void setText(TextView textView, String text) { if (textView != null) { if (text == null) text = ""; textView.setText(text); } else { throw new IllegalArgumentException("A view is null in your parameters."); } } }