In-App Purchase remove ads

It depends on how you inserted the ads in the first place. If you did it via code, then just put an if(removed ads == false) around the code that inserts ads.

If you did it via XML, then the best way to do it is to copy out your XML, without the adview, and in your code use if surrounding all of your setContentView(R.layout.example)

Here’s an example of what I mean

if (adsDisabled == true){
    setContentView(R.layout.mainNoAds)
} else{
    setContentView(R.layout.main
}

In-app purchases –

http://developer.android.com/guide/google/play/billing/billing_overview.html

In this post I assumed you are using admob, but the same should be true for all companies

On last thing – using adView.View.GONE IS bad practice **DO NOT ** do that

Leave a Comment