<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="enableAds">true</bool> <!-- true or false -->
</resources>
this is what res/values/bools.xml looks like.
then I’m doing
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="match_parent"
ads:adSize="BANNER"
ads:adUnitId="@string/admobPubId"
ads:loadAdOnCreate="@bool/enableAds"/>
but it won’t work. any ideas why? it should work http://developer.android.com/guide/topics/resources/more-resources.html#Bool
Put your adview in separate xml and include it wherever required.
Ex:
adview.xml
other.xml