标签:分享 默认 theme button 场景 exce tar exception 技术
出现场景:
在一个Button中定义了onclick属性,值为startChat。
在Activity中定义一个方法。
public void startChat(View view){}
运行时,点击按钮,就会出现这个异常。
这是因为activity继承的是AppCompatActivity,默认使用的主题是@style/AppTheme
把activity的主题去掉,再运行就不会报错了。
如图 删除掉蓝色选中区域
个人建议还是使用onClickListener设置监听。
作者:旺仔大牛
原文:https://blog.csdn.net/adojayfan/article/details/52525957
[Bug合集] java.lang.IllegalStateException: Could not find method onClickcrea(View) in a parent
标签:分享 默认 theme button 场景 exce tar exception 技术
原文地址:https://www.cnblogs.com/cjdty/p/9944729.html