layout - how to read value from string.xml in android? -
I wrote this line:
string mas = r String.message_1;
To get the string value, but instead of returning string, it is giving me the type of integer ID, can someone guide me how I can get its string value Am I I've mentioned the string value in the string.xml
file.
Any help would be appreciated.
try it
string mess = getResources (). GetString (R.string.mess_1);
UPDATE
string string = getString (R.string.hello);
You can use the getString (int)
or getText (int)
to get a string. Retaining any rich text style applied to the getText (int)
string.
Reference:
Comments
Post a Comment