Issue
I have constant String values in the strings.xml, and I want to display some of these values from the Log.i. I tried the following
Log.w(TAG, Integer.toString(R.String.bt_value));
But at run time, what is getting displayed is "R.String.bt_value"
How to display that value correctly?
Solution
If you want to retrieve a String
from R.string.xxx (one of resource xml files), use getResources().getString(id)
.
Log.w(TAG, getResources().getString(R.String.bt_value));
Answered By - hata
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.