Java tutorial
//package com.java2s; import android.app.Activity; import android.widget.TextView; public class Main { public static void displayText(Activity activity, int id, String text) { TextView tv = (TextView) activity.findViewById(id); tv.setText(text); } }