Thursday, 15 May 2014

java - Leadbolt ad integration in libgdx -



java - Leadbolt ad integration in libgdx -

i'm new in libgdx , i'm trying show leadbolt ads in app. i've found forum thread http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=9072&p=41323#p41323 communicating android , libgdx. i've build related interfaces , etc. interface works well, i've tried give message on showad() , works well. when i'm trying add together given code leadbolt, shows error on "this". code attached below. guess has simple solution java knowledge not plenty solution :)

public class androidbrowseropener implements actionresolver{ private adcontroller ad; @override public void showad() { // todo auto-generated method stub advertisement = new adcontroller(this, "my advertisement id"); ad.loadad(); } }

my main activity

public class mainactivity extends androidapplication { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); initialize(new fatninja(new androidbrowseropener())); super.oncreate(savedinstancestate); } }

core interface

public interface actionresolver { public void showad(); }

i'm calling showad() main within create().

thanks replies.

edit:

thanks answer, i've found context illustration badlogic forums below, not showing ads. gives error: e/lbadcontroller(5088): loadad() failed - valid activity not passed code below:

public class androidbrowseropener implements actionresolver {

private adcontroller ad;

public androidbrowseropener(context context){ advertisement = new adcontroller(context, "my id"); } @override public void showad() { // todo auto-generated method stub ad.loadad(); system.out.println("it works"); } }

use adlistner instead of . think work

if posted code finish code have understand utilize of interface used. have send context phone call method. plz understand calling of method

java android libgdx leadbolt

No comments:

Post a Comment