Jaison Brooks Jaison Brooks - 1 year ago 98
Java Question

A boolean value defined in XML. How to reference in Java?

I'm trying to write some code that will reference a bool.xml file and will reference the current value inside the bool.

<bool name="enableQAurl">true</bool>

With this i want to be able to reference this in code, so that if its set to True it does something and if false does something else. Just a simple If and else statement.

Any code references or feedback is greatly appreciated.

Answer Source
 Resources res = getResources();
 boolean enableQAurl = res.getBoolean(R.bool.enableQAurl);


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download