Java tutorial
//package com.java2s; import android.content.Context; import android.content.res.Resources; public class Main { private static Context context; public static int getResStyleID(String resName) { Resources res = context.getResources(); return res.getIdentifier(resName, "style", context.getPackageName()); } }