我正在使用钛 admob 模块,found here
我的应用有多个页面,所以我在其中几个页面上加载了广告。
我的问题是,在几次访问之后,每个广告似乎都没有被垃圾收集或杀死,所以在我的输出中我可以看到很多信息语句,表明应用程序正在检查广告。这些不是每 60 秒发生一次,更接近每 5 秒一次。
我假设这会在应用运行时导致一些退化/电池使用。
有人知道我是如何“杀死”admob 广告的刷新的吗?如果它特定于钛,那很好。如果它特定于 android,那么请告诉我方法调用和概念,我会看看是否可以将其转换为 js titanium 代码!
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
[INFO] : APSAnalyticsService: Analytics Service Started
[INFO] : APSAnalyticsService: Stopping Analytics Service
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
[INFO] : Ads: Ad is not visible. Not refreshing ad.
[INFO] : Ads: Scheduling ad refresh 60000 milliseconds from now.
最佳答案
Activity生命周期的onPause()方法,考虑暂停AdView mGoogleAdView;
if (mGoogleAdView != null) {
mGoogleAdView.pause();
}
在生命周期的onDestroy方法中考虑
mGoogleAdView.destroy();
P.S:我没有用过 Titanium。
关于android - Titanium Admob 不断检查新广告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28376488/