Replace the if statements, you should use two equalities instead of one. It would be right
if (AdViewStarted == true) { adView.destroy(); }
or better
if (AdViewStarted) { adView.destroy(); }
As a result of winning, variable names begin with the lowercase char.
Also, what are you trying to use in onCreate ?
This is correct (I think if not, show me the layout of the xml file and LogCat):
LinearLayout adView = (LinearLayout) findViewById(R.id.adView); adView.loadAd(new AdRequest()); AdViewStarted = true;
source share