Resource int R.string.app_name to String Android example

R.string.app_name to String example.
MyActivity.java

Resources res = getResources();
String sText = res.getString(R.string.app_name);

res/values/string.xml

 
<resources>
    <string name="app_name">My app name</string>
</resources>
This entry was posted in Android Examples Code and tagged , . Bookmark the permalink.


Comments are closed.



8,330 views