You could do something like:
int resourceId = this.getResources().getIdentifier("btn_name", "id", this.getPackageName());
where this
refers to the context
/activity
. Then use it as follows:
ImageButton imageButton = (ImageButton) findViewById(resourceId);