android - Dataconnection is not there, then instead AD want to draw something -


i have ad in application. if not connected internet, want draw text instead of ad. how can find out once ad has come application? there methods detect that? in advance

you can use adlistener detect whether adview receives ads or not.

adview adview = new adview(activity, adsize.banner, "xxxxxxxxxx"); adview.setadlistener(new adlistener() {     @override public void onreceivead(ad arg0) {         // method called when ad received     }     @override public void onfailedtoreceivead(ad arg0, errorcode arg1) {         // method called when ad cannot received     }     @override public void onpresentscreen(ad arg0) {  }     @override public void onleaveapplication(ad arg0) { }     @override public void ondismissscreen(ad arg0) { } }); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -