txtt.setText(getString(R.string.(“i” + j++)));
问题 What's wrong with this code? I want to use id automatically. I think after R.string there is a mistake. What can ı do 回答1: Do it like this public static int getStringIDFromName(String stringName) { int stringID= 0; if(stringName == null || stringName.equalsIgnoreCase("")) { return 0; } try { @SuppressWarnings("rawtypes") Class res = R.string.class; Field field = res.getField(stringName); stringID = field.getInt(null); } catch(Exception e) { // Error } return stringID; } Set your value like