int resourceID = this.getResources().getIdentifier("resource name", "resource type as mentioned in R.java",this.getPackageName());