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

    结果:已解决

  • 相关阅读:
    申请加分项
    课程评价
    本周总结
    热词2
    热词1
    php大作业
    css网格布局
    php实验4
    本周总结
    css边框图像
  • 原文地址:https://www.cnblogs.com/insist8089/p/7149836.html
Copyright © 2011-2022 走看看