(Android Studio Kotlin) 함수가 DataBinding xml에 표시되지 않는 경우
MVVM – DataBinding 항목에 onClick 함수를 넣으려고 하는데 작동하지 않습니다. 함수를 찾을 수 없기 때문에 빨간색 선이 나타납니다. <?xml version=”1.0″ encoding=”utf-8″?> <layout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto”> <data> <variable name=”viewModel” type=”com.example.databindingtest.JoinActivity” /> </data> <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.JoinActivity”> <Button android:id=”@+id/testButton” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:onClick=”@{()->viewModel.goToMainActivity()}” android:text=”test” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintStart_toStartOf=”parent” app:layout_constraintTop_toTopOf=”parent” /> </androidx.constraintlayout.widget.ConstraintLayout> </layout> 내가 사용한 줄 알았는데 입력 이름 및 … Read more