I am integrating AdMob into my app and I wonder how to disable Ads correctly. I want to give the user the ability to disable them. I don\'t want to get any problems with AdM
setVisibility(VIEW.GONE); will remove the adview from the layout.
There might be away to fully remove it from the layout, but I've never had to do that.
Just setting the view's visibility to GONE is enough.
If you read the Logcat output, it prints "I/Ads: Ad is not visible. Not refreshing ad.".
Give it all you've got, just to be on the safe side:
if (mAdView != null) {
mAdView.setEnabled(false);
mAdView.setVisibility(View.GONE);
ViewGroup parent = (ViewGroup) mAdView.getParent();
if (parent != null) parent.removeView(mAdView);
mAdView.removeAllViews();
mAdView.destroy();
}