java.lang.IllegalStateException: Could not find a method XXX

╰+哭是因爲堅強的太久メ 2023-05-31 03:25 52阅读 0赞

问题:

点击按钮的时候出错

  1. java.lang.IllegalStateException: Could not find a method bindSim(View) in the activity class chapter05.qst.com.mobileguard.
  2. activity.Test2Activity for onClick handler on view class android.widget.TextView

原因:

1.没有定义XXX方法

2.没有调用XXX方法

解决:

ctrl+shift+alt+n调出搜索框,查找XXX方法的位置

1.注释掉

2.右键Find Usages找到引用位置,检查是否引用错误

总结:

空指针异常

发表评论

表情:
评论列表 (有 0 条评论,52人围观)

还没有评论,来说两句吧...

相关阅读