Java tutorial
//package com.java2s; //License from project: Apache License import android.view.View; public class Main { public static <T extends View> T find(View view, int id) { return (T) view.findViewById(id); } }