Java tutorial
//package com.java2s; import android.app.Activity; import android.widget.Button; public class Main { public static Button get_button(Activity activity, int id) { Button b = (Button) activity.findViewById(id); return b; } }