0

I implemented one interface in that it has to implement requestAd on success and failure, onLeaveApplication, onPresentScreen , onReceiveAd. I also extended the AdwhirlLayout class. I implemented only two methods in Adaptor.java class requestAd on success and failure only by these lines

public void requestAdSuccess() {
    // TODO Auto-generated method stub
    adWhirlLayout.adWhirlManager.resetRollover();
    adWhirlLayout.nextView = adView;
    adWhirlLayout.handler.post(adWhirlLayout.viewRunnable);
    adWhirlLayout.rotateThreadedDelayed();
}

public void requestAdFail() {
    // TODO Auto-generated method stub
    adView.setAdListener(null);
    adWhirlLayout.rollover();
}
public void onLeaveApplication(Ad arg0) {
    // TODO Auto-generated method stub

}

public void onPresentScreen(Ad arg0) {
    // TODO Auto-generated method stub

}

public void onReceiveAd(Ad arg0) {
    // TODO Auto-generated method stub

}

I refresh my ad every 15 seconds. I wrote this based on GoogleAdAdaptor.java code in adwhirl sample. What else do I have to add to the code in onLeaveApplication()?

Verbeia
  • 4,400
  • 2
  • 23
  • 44
Sindhu Perumalla
  • 425
  • 1
  • 6
  • 14

1 Answers1

1

Please read my response to a similar question here for information about implementing custom events.

From the code you've posted here, AdWhirlLayout doesn't have a nextView so I don't think adWhirlLayout.nextView = adView; will work. Also, I think you will want to post the view runnable like this:

adWhirlLayout.handler.post(new ViewAdRunnable(adWhirlLayout, adView));

As far as I know, you're not missing anything in onLeaveApplication, unless the specific ad network you're working with does something special on leave.

Community
  • 1
  • 1
Eric Leichtenschlag
  • 8,881
  • 1
  • 28
  • 28