I want to create an alertdialog with a string present in String.xml but R.string.string1 returns an int. Please tell me how to get a string in string.xml format, 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);
user2125834
source
share