How to access string present in string.xml

view story

http://stackoverflow.com – I want to build the alertdialog with the string present in String.xml but R.string.string1 is returning int. Please tell me the way to get the string prestent in string.xml here is my code.. public static void showAlert(String alertMessage) { final AlertDialog.Builder builder = new AlertDialog.Builder(null); builder.setMessage(alertMessage); final AlertDialog alert = builder.create(); alert.show(); } showAlert(R.string.string1); (HowTos)