问题描述
一位用户报告说,当 admob 广告有动画时,应用的 html 视图闪烁".
A user reported that the html view of the app "flickers" when the admob ad has an animation.
这是他录制的一个小视频:http://www.youtube.com/watch?v=gQ7yxzpqfDA
Here's a small video he recorded: http://www.youtube.com/watch?v=gQ7yxzpqfDA
我在手机上看不到,但他的三星 S3 显示了这个问题.
I can't see that on my phone, but his Samsung S3 shows this problem.
知道它是什么吗?或者我怎样才能禁用这种广告?
Any idea what can it be? or how I can disable this kind of ads?
谢谢!哈维尔
推荐答案
我遇到了类似的问题,在这里看到我的闪烁:
I was having a similar issue, see my flickering here:
https://www.youtube.com/watch?v=AfKbrw2qQmg
在我的情况下触发它的是我在应用程序级别进行的配置更改(区域设置更改).
What triggered it in my case was a configuration change i was doing (a locale change) at the Application level.
Configuration config = getBaseContext().getResources().getConfiguration();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
config.setLocale(mLocale);
} else{
config.locale = mLocale;
}
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); // <--- THIS IS THE PROBLEM, WHY I DON'T KNOW
其中 mLocale
是一个带有更改设置的 Locale
对象.
Where mLocale
was a as Locale
Object with changed settings.
我尝试自己在清单代码中处理配置更改,因为这可能是应用程序/活动神奇地重新启动自身的原因(感谢 Android):
I tried handling the configuration change myself in the manifest code as this might be a cause for the application/activity to magically relaunch itself (thanks Android):
...
<application
android:name="com.myapp.myapp"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@drawable/icon"
....
但这没有任何效果.
所以我对这个晦涩的问题的回应是检查您的应用是否正在对配置进行一些更改并重新评估.
So my response for this obscure problem is to check if your app is doing some changes to the configuration and re-evaluate that.
adMob 支持也记录了问题,他们非常乐于尝试并提供帮助 https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/b1K4Ow59eWY
Issue also logged with adMob support who have been very good to try and help https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/b1K4Ow59eWY
这篇关于Phonegap 屏幕随着 AdMob 动画闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!