Issue
I have the following integer resources in my strings.xml file
<item type="integer" name="pID" format="integer">374</item>
<item type="integer" name="vID" format="integer">3468</item>
I want to call them from my code to get 374 and 3468.
However, when I output to Logcat...
Log.d("MainActivity.onCreate","pID: "+R.integer.pID+" vID: "+R.integer.vID);
I see the following...
pID: 2131230720 vID: 2131230721
Why are R.integer.vID
and R.integer.pID
returning ints other than 3468 and 374 respectivley?
Solution
You are printing out the resource IDs. Use Resources.getInteger(resourceId)
instead.
http://developer.android.com/guide/topics/resources/more-resources.html#Integer
Answered By - harism
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.