android - Titanium Admob 不断检查新广告

标签 android titanium admob

我正在使用钛 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/

相关文章:

android - 我想发布嵌套的 json 数据

Android:触摸按钮 3 或 4 秒后显示选项菜单

android - Titanium Appcelerator 可以用于 Windows 机器中的 IOS 应用程序开发吗

java - MobileAds.initialize(Context, String) 已弃用

java - 带有 Appodeal 的原生广告

android - 获取 ionic 存储中的所有存储 key

android - 应用程序是否应该处于运行状态才能触发 Intent ?

javascript - Titanium 中的事件未正确触发

android - 版本兼容性

android - 没有足够的空间来展示广告!想要 : <480, 75>,有 : <432, 1073741823>