1

I'm trying to add a banner using Mobfox in my App. Following the guide provided by Mobfox I add this code into MainActivity.java in onCreate method:

layout = (RelativeLayout) findViewById(R.id.rel_lay);

if (mAdView != null) {
    mAdView = new AdView(this,"http://my.mobfox.com/request.php"
        , "fe96717d9875b9da4339ea5367eff1ec", true, true);
    mAdView = setAdListener(this);
    layout.addView(mAdView);
}

But I obtain this error: "The method setAdListener(MainActivity) is undefined for the type MainActivity". How to define that method? I can't find in the Mobfox's guide.

How to make the banner works?

Mario Kutlev
  • 4,897
  • 7
  • 44
  • 62
Gimmy88
  • 295
  • 2
  • 5
  • 13

1 Answers1

0

You have to set AdListener to your mAdView as shown in the MobFox Android SDK Setup Guide. Use the code below:

mAdView = new AdView(this, "http://my.mobfox.com/request.php",
    "fe96717d9875b9da4339ea5367eff1ec", true, true);
mAdView.setAdListener(this);
layout.addView(mAdView);

Your activity must implement AdListener.

Mario Kutlev
  • 4,897
  • 7
  • 44
  • 62