java.lang.IllegalStateException: Could not find method onButton1Clicked(View) in a parent or ancestor Context for android:1 [ 에러 ] java.lang.IllegalStateException: Could not find method onButton1Clicked(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.button.MaterialButton with id 'button2' AndroidStudio 실행시 다음과 같은 에러메시지가 발생하였습니다. java.lang.IllegalStateException: Could not find method onButton1Clicked(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.button.MaterialButton with id 'button2' 그래서 해결책을 찾아보니 다음과 같습니다. 즉, ButtonC1clicked 부분에서 Protected라고 되어있는 부분을 public으로 변환해주면 해결됩니다. protected 및 public 등 접근제한자에 대해 자세히 알.. 2021. 5. 9. 이전 1 다음