Phonegap screen flickers with AdMob animation

和自甴很熟 提交于 2020-01-02 08:08:30

问题


A user reported that the html view of the app "flickers" when the admob ad has an animation.

Here's a small video he recorded: http://www.youtube.com/watch?v=gQ7yxzpqfDA

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?

Thanks! Javyer


回答1:


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

Where mLocale was a as Locale Object with changed settings.

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"
....

But that has no effect.

So my response for this obscure problem is to check if your app is doing some changes to the configuration and re-evaluate that.

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



来源:https://stackoverflow.com/questions/19934313/phonegap-screen-flickers-with-admob-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!