I have a simple AdView control in my application and it works good on many phones and tablets and with different android versions from 2.2 to 4.0.3. However, on two HTC phone, one is HTC Amaze 4G and another is HTC one X, both running android 4.0.3. The ad is flickering a lot once shown. Usually when an adview switch ads, it will have an animation with text moving smoothly, but with those phone, it just flickering with no animation is shown.
On the same phone we checked other applications with admob and they are fine.
Following is the code we use, and it is a very simple one:
adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID); //320x50
if( adView != null )
{
//Add the adView to it
adlayout.addView(adView);
//Initiate a generic request to load it with an ad
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(adRequest);
}
The adlayout is a relative layout and I am sure it is big enough to hold the adview. I have searched on the internet and only find the following discussion about it:
Based on the discussion, I have tried three different type. Unfortunately, none of it works. Only make it even worse. When I try the LAYER_TYPE_HARDWARE, it became blank most of the time, only after a while a ad will show with flickering. The other two flickering as well.
adView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
adView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
adView.setLayerType(View.LAYER_TYPE_NONE, null);
Could someone helps me?
Thanks,