Java tutorial
//package com.java2s; import android.app.Activity; import android.view.View; public class Main { public static View findViewByIdString(Activity a, String s) { return a.findViewById(a.getResources().getIdentifier(s, "id", a.getPackageName())); } }