zoukankan      html  css  js  c++  java
  • 错误提示: Caused by: java.lang.ClassCastException: com.example.cheung.sbulter.MainActivity cannot be cast to android.view.View.OnClickListener

    问题描述:在安卓模拟上运行程序,程序闪退,显示:xx has stopped

                      提示:Caused by: java.lang.ClassCastException: com.example.cheung.sbulter.MainActivity cannot be cast to android.view.View.OnClickListener

    解决办法:In MainActivity, you should implement View.OnClickListener. in this case, you don't need your own interface XXXXXXX.java, just use View.OnClickListener

                      that is to say, change   

                     public class MainActivity extends Activity implements onClickListener

                     to 

                    public class MainActivity extends Activity implements View.OnClickListener

    结果:已解决

  • 相关阅读:
    poj1573
    poj2632
    poj2993 poj2996
    poj3295 构造法
    poj2965枚举
    poj1753 枚举
    poj942Paths on a Grid
    poj1019
    poj1321棋盘问题
    博客园访问量有些小,我就没有必要在复制一份了,博客园就这样吧,继续CSDN了。
  • 原文地址:https://www.cnblogs.com/insist8089/p/7149836.html
Copyright © 2011-2022 走看看