Android examples for android.content:Context
get String by resource id
import android.content.Context; import java.io.ByteArrayOutputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static String getString(Context context, int resourceId) { try {/*ww w. j av a2 s .co m*/ String res = context.getResources().getString(resourceId); return res; } catch (Throwable e) { } return null; } }