Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.res.Resources; public class Main { public static int resolveId(Context context, Resources res, String string) { if (string.startsWith("@")) { String subs = string.substring(1, string.length()); String[] parts = subs.split("/"); if (parts[0].startsWith("+")) parts[0] = parts[0].substring(1); return res.getIdentifier(parts[1], parts[0], context.getPackageName()); } return Integer.parseInt(string); } }