You can try to Destroy and hide the AdView when button click and load the ad back when required. final AdView adView = (AdView) this.findViewById(R.id.adView); final AdRequest adRequest = new AdRequest.Builder().build(); adView.loadAd(adRequest); button.setText("ClickMe"); button.setOnClickListener(new View.OnClickListener() { boolean isPause = false; @Override public void onClick(View v) { if(isPause){ adView.loadAd(adRequest); adView.setVisibility(View.VISIBLE); isPause...
As the example in https://developer.android.com/reference/com/google/android/gms/ads/AdView.html and the document for AdView.destroy(), you should only call adView.pause() in onPause(), and call adView.destroy() later in onDestroy(). The stack dump looks like another thread is accessing the destroyed AdView instance....
your problem is with this line import com.google.android.gms.R; remove this and import your package .R file import <package name>.R ...
android,admob,google-dfp,adview
Actually you can use any size you want (as long as it fits), my client provides small ad sizes and we manage to make it work. "As long as it fits" means for example, when you write something like: AdSize[] adSizes = {new AdSize(89, 31), AdSize.SMART_BANNER}; And your provided ad...
The Admob AdView uses a WebView.
One of Google Mobile Ads SDK Team said (March 14), We looked into this issue when it was first reported, and a fix has been released within Google Play services. You should see fewer and fewer instances as your users' devices update to the new version. Refer to https://groups.google.com/forum/#!topic/google-admob-ads-sdk/oYpQI_L14Tg...
I am not sure why all the examples in every post on the internet about this are wrong, but I am assuming that onReceiveAd is simply old code that is not relevant any more. With that in mind, I got exactly what I was after by using a different command:...