Java tutorial
//package com.java2s; import android.app.Activity; import android.view.View; import android.widget.TextView; public class Main { public static TextView findTextViewById(int resid, Activity activity) { return (TextView) activity.findViewById(resid); } public static TextView findTextViewById(int resid, View view) { return (TextView) view.findViewById(resid); } }