为什么AdMob的导致高CPU后,Android应用程序暂停或停止 [英] Why admob cause high cpu after android app paused or stopped

查看:185
本文介绍了为什么AdMob的导致高CPU后,Android应用程序暂停或停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个应用程序,都使用Admob的,一个是调解,另一个只是AdMob的。由于Android 2.3编写的那些应用程序,没有任何问题,直到安卓4.0发布。现在,我的用户抱怨CPU使用率过高,施药后关闭或暂停(即使没有启动服务)

I have two application, both using Admob, one with mediation and another one just admob. Those app written since android 2.3, no problem until Android 4 released. Now my users complaining about high cpu usage, after application closed or paused (even without starting service)

我苦苦寻觅的原因,但没有解决办法呢,我发现的是,当AdMob提供的广告显示,经过pressing家高CPU使用率开始。但是,当广告仍未显示出,没有任何问题。

I have struggle to find the cause but no solution yet, what i found is when ads from Admob shown, high cpu usage started after pressing home. But when ads not yet shown, no problem

即时通讯使用的Andr​​oid 4.3和CPU使用率监视的使用电池设置,CPU使用率从开发者的选择。

Im using android 4.3 and cpu usage monitored using battery setting and cpu usage from Developer option.

想如果有更多的信息需要修改的问题。请帮忙

Would like to revise question if more info needed. Please help

推荐答案

请确保您的活动处理移动到适当的背景:

Make sure that your Activity handles moving to background appropriately:

public void onPause() {
  super.onPause();
  adView.stopLoading(); // Remember to startLoading again in #onResume
}

public void onDestroy() {
  super.onDestroy();
  adView.destroy();
}

这篇关于为什么AdMob的导致高CPU后,Android应用程序暂停或停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆