Reputation: 37627
Im getting this error:
- The type AdListener cannot be a superinterface of AdManager; a superinterface must be an
interface
When im trying to implement ADMOB AdListener on my app:
import com.google.android.gms.ads.AdListener;
public class AdManager implements AdListener{
What am i doing wrong?
Upvotes: 0
Views: 4260
Reputation: 6826
According to the new SDK (Google Play Services)
You no longer implement AdListener from your Activity or class..
You can use it as an inner class:
adView.setAdListener(new AdListener() {
public void onAdLoaded() {}
public void onAdFailedToLoad(int errorcode) {}
// Only implement methods you need.
});
(Taken from: https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration)
Upvotes: 7
Reputation: 43023
AdListener
is a class, not an interface so your class needs to inherit from it, not implement it. Use extends
keyword, not implements
.
public class AdManager extends AdListener{
}
Upvotes: 4