中间找到R 中的id,从而找到value下的string context
try {
Field field = R.string.class.getField("hello");try {
int id = field.getInt(new R.string());
Log.d("pin2", "id:" + id);
String str = getString(id);
Log.d("pin2", "str:" + str);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (NoSuchFieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}