admob - Android interstitial only displaying once -
i can display once, when request ad or try display same ad again not work..it displays once no matter do. tried
i have oncreate
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); minterstitialad = new interstitialad(this); minterstitialad.setadunitid(getstring(r.string.interstitial_ad_unit_id)); adrequest adrequestinterstial = new adrequest.builder() .addtestdevice("xxxxxxxxxxxxxxxxxxx") .build(); minterstitialad.loadad(adrequestinterstial);
then have summoning code
if(minterstitialad.isloaded()){ minterstitialad.show(); requestnewinterstitial(); }
and requestnewinterstitial code:
private void requestnewinterstitial() { adrequest adrequest = new adrequest.builder() .addtestdevice(adrequest.device_id_emulator) .addtestdevice("xxxxxxxxxxxxxxxxxxxxxxx") .build(); minterstitialad.loadad(adrequest); }
thank you.
//listner adclosed fixed situation minterstitialad.setadlistener(new adlistener() { @override public void onadclosed() { adrequest adrequest = new adrequest.builder() .addtestdevice("xxxxxxxxxxxxxxxxxx") .build(); minterstitialad.loadad(adrequest); } });
Comments
Post a Comment