【问题标题】:error when adding GPS library admob添加 GPS 库 admob 时出错
【发布时间】:2015-03-12 00:27:56
【问题描述】:

错误是:

AdListener 类型不能是 FlyingPanda 的超接口;超接口必须是接口

   public class FlyingPanda  extends Activity implements AdListener {

问题出在哪里,我尝试通过扩展替换工具关键字,但错误仍然存​​在。

需要你帮忙吗

【问题讨论】:

    标签: gps admob extends implements


    【解决方案1】:

    根据docs,

    您不能再从您的 Activity 或类中实现 AdListener

    您可以将其用作匿名内部类:

    对于插页式广告:

     interstitalAd.setAdListener(new AdListener() {
      public void onAdLoaded() {}
      public void onAdFailedToLoad(int errorcode) {}
      // Only implement methods you need.
    });
    

    对于横幅广告

    adView.setAdListener(new AdListener() {
      public void onAdLoaded() {}
      public void onAdFailedToLoad(int errorcode) {}
      // Only implement methods you need.
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-22
      • 2015-03-02
      相关资源
      最近更新 更多