라벨이 인 게시물 표시

Kotlin Room database, KTX ViewModel을 활용을 한 메모앱 만들기

이미지
개발환경 안드로이드 스튜디오 4.1.1 JDK 1.8 모든 코드는  간단한 메모앱(github) 에 있습니다. 완성된 앱 프로젝트 생성 Empty Activity 선택 Language를 Kotlin으로 선택 Minimum SDK API21 선택 후 Finish 클릭 UI 그리기 ConstraintLayout에 값을 입력할 EditText 하나, 이벤트를 위한 Button 하나 입력 된 데이터를 보여주기 위한 TextView 하나를 그려줍니다. <androidx.constraintlayout.widget.ConstraintLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" android :layout_width ="match_parent" android :layout_height ="match_parent" tools :context =".MainActivity" > <EditText android :id ="@+id/editTextTextPersonName" android :layout_width ="0dp" android :layout_height ="wrap_content" android :layout_marginStart ="16dp" android :layout_marginTop ="16dp" android :layout_marginEnd ="16dp...