定义Button事件的时候出现错误:
The type new DialogInterface.OnClickListener(){} mustimplement the inherited abstract methodDialogInterface.OnClickListener.onClick(DialogInterface, int)
源码如下:
原因:
因为android里面有两个包里面都有OnClickListener的接口,这么写代码的话,程序自己不会判断用哪个接口,所以会报错。
解决办法:
private View.OnClickListener listener=new View.OnClickListener()
这么修改就好了!
