me: FATAL EXCEPTION: main
Process: parking.fujichina.net.ch03_linearlayout, PID: 596
java.lang.IllegalStateException: Could not find method showCont(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatButton with id 'btn_ok'
Process: parking.fujichina.net.ch03_linearlayout, PID: 596
java.lang.IllegalStateException: Could not find method showCont(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatButton with id 'btn_ok'
在创建方法(在 onclick 中定义的)是少了参数:
public void showCont(){}
应该更为:
public void showCont(View v){}
欢迎光临淘宝店:舒佰特鞋铺