(new Admob from GPS) AdView.destroy()/pause()/resume() necessary/mandatory?

296 views
Skip to first unread message

Tony Chan

unread,
Jul 31, 2014, 9:24:20 PM7/31/14
to google-adm...@googlegroups.com
For the new Google mobile ads API in the Google Play Services library, are the methods destroy()/pause()/resume() necessary? I understand that in the original standalone AdMob SDK the destroy() method was optional and was only needed on some older versions of Android apparently.

If I forgo calling these methods from my Activity's corresponding lifecycle callbacks will there be any adverse effects?

If I do call the pause()/resume() methods will they actually pause the loading of new ads if say an overlay of an Activity Dialog pops up over my app?

Eric Leichtenschlag

unread,
Aug 1, 2014, 8:18:52 PM8/1/14
to google-adm...@googlegroups.com
AdView.pause() and AdView.resume() just forward the calls to webView.onPause() and webView.onResume() right now. They don't stop loading/refreshes of ads yet, but we've thought about using it at some point in the future as a better (or additional) signal to stop refreshing ads than the current check if the AdView is visible.

The onPause and onResume calls will also be forwarded to any mediation networks or custom events using the new mediation/custom event APIs.

destroy() forwards to webView.destroy() and also does some other internal cleanup. We don't have 1.x Android webview crashes anymore but we still recommend calling this.

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages