I’ve only ever had to work with Strings within the strings.xml file before, but now I have a case where I need to work with Boolean and Integer items.
<item type="integer" name="usenetPort">563</item>
<item type="bool" name="usenetUseSSL">true</item>
I usually use getResources().getString(R.strings.my_string) to retrieve a value, but that doesn’t work with Boolean and Integers. I tried getInteger() and getBoolean() but Eclipse says that’s wrong.
How do I get the value from Booleans and Integers?
It works for me, first I openned Strings.xml and added this:
Then in the code I get the value by doing this:
You have to use R.integer.* and not R.string.*