Android examples for android.app:Activity
Find View by view id
import android.app.Activity; import android.content.Context; import android.content.Intent; import android.view.View; import android.widget.Button; import android.widget.EditText; public class Main{ @SuppressWarnings("unchecked") public static <T extends View> T Find(Activity activity, int id) { return (T) activity.findViewById(id); }//from ww w .j a v a2s.c o m }