강아지를 좋아하는 컴공생

[Error] Expecting member declaration - Kotlin / Android 본문

카테고리 없음

[Error] Expecting member declaration - Kotlin / Android

정인하이 2022. 10. 30. 17:42

 

함수 안에 넣어줘야한다고 한다. <- 이유 아직 모름

onCreate함수 안에 넣었더니 잘 됨.

https://stackoverflow.com/questions/72262023/expecting-member-declaration-even-though-the-val-is-declared-the-line-above

 

Expecting member declaration even though the val is declared the line above

I looked at all of the other questions about this error, but none of them helped. I am trying to create a reference to a button in my layout file, and when I set the onClickListener, I get "

stackoverflow.com