java.lang.IllegalStateException: Could not find method myClick(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.button.MaterialButt
Android开发报错:
java.lang.IllegalStateException: Could not find method myClick(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.button.MaterialButton.
我的错误点:函数写成private了,直接去掉也会出错,要写成public,此时myClick也变成黄色了,然后跳转成功了。