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

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -