android - PublisherAdView is not showing ad,but adListener tells me that ad is loaded -
guys. have 2 publisheradviews in project(here test app) sizes banner , medium_rectangle. banner size working great,but medium_rectangle not,i can see glimpses on screen(like shadow pop-up) , screen background. adlisneter tells me ad loaded , ok. dont know do. tried add publisheradviews in xml , programmatically,but have no results. here xml
<com.google.android.gms.ads.doubleclick.publisheradview android:id="@+id/ad_view_small" android:layout_width="match_parent" android:layout_height="wrap_content" ads:adsize="banner" ads:adunitid="/108874508/lebfile-mobileapp-320x50"> </com.google.android.gms.ads.doubleclick.publisheradview> <com.google.android.gms.ads.doubleclick.publisheradview android:id="@+id/ad_view_big" android:layout_width="match_parent" android:layout_height="wrap_content" ads:adsize="medium_rectangle" ads:adunitid="/108874508/lebfiles-300x250-hp-mobile"> </com.google.android.gms.ads.doubleclick.publisheradview>
and here implementation
publisheradrequest adrequest = new publisheradrequest.builder().build(); publisheradview madview2 = (publisheradview) findviewbyid(r.id.ad_view_small); madview2.loadad(adrequest); publisheradview madview1 = (publisheradview) findviewbyid(r.id.ad_view_big); madview1.loadad(adrequest);
as can see it's identical,but big ad does't display. how tried adding ad manually,again no results.
rlbanner = (relativelayout)findviewbyid(r.id.rlbanner); publisheradview adview = new publisheradview(mainactivity.this); adview.setadsizes(adsize.medium_rectangle); adview.setadunitid("/108874508/lebfiles-300x250-hp-mobile"); adview.setid(999); adview.loadad(adrequest); @suppresswarnings("deprecation") relativelayout.layoutparams params = new relativelayout.layoutparams(viewgroup.layoutparams.match_parent, viewgroup.layoutparams.wrap_content); params.addrule(relativelayout.align_parent_top, relativelayout.true); adview.setlayoutparams(params); rlbanner.addview(adview); rlbanner.bringchildtofront(rlbanner.findviewbyid(999));
thx,for reading , helping cause situation pretty bad.
Comments
Post a Comment