Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; public class Main { public static String getStringFromXml(Context context, String name) { if (context != null) { int id = context.getResources().getIdentifier(name, "string", context.getPackageName()); String text = context.getString(id); return text; } else { return ""; } } }