must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int)问题

依照视屏编写代码如下

class MyButtonListener implements OnClickListener{
  @Override
  public void onClick(View v){
    ;
  }
}

提示MyButtonListener有问题

提示详情The type ActivityA.MyButtonListener must implement the inherited abstract method DialogInterface.OnClickListener.onClick(DialogInterface, int)

onClick问题提示如下

The method onClick(View) of type ActivityA.MyButtonListener must override or implement a supertype method

 

发现快速修改提示中提示增加abstract修饰词,估计在现在编译器版本中吧OnClickListener改为abstract类,于是修改如下

abstract class MyButtonListener implements OnClickListener{

  public void onClick(View v){
    ;
  }
}

修改后问题提示消失,后期再观察是否有影响

 

///////////////////////////////////////////////////////////////////

 

实现这个类后,根据提示,修改如下

abstract class MyButtonListener implements android.view.View.OnClickListener

posted @ 2014-11-06 21:37  magic_forever  阅读(354)  评论(0编辑  收藏  举报