A boolean value defined in XML. How to reference in Java?
Resources res = getResources();
boolean enableQAurl = res.getBoolean(R.bool.enableQAurl);
Source:
http://developer.android.com/guide/topics/resources/more-resources.html
The above answer of kaderud's will work perfectly. If you are not in Activity, you have to use your context.
If you are in fragment or adapter then you have to follow below.
boolean enableQAurl = context.getResources().getBoolean(R.bool.enableQAurl);