강의

멘토링

커뮤니티

Inflearn Community Q&A

choidaehwan92822002's profile image
choidaehwan92822002

asked

[Beginner Edition] Learning Android Kotlin by Building 8 Apps

Saving to Firebase Realtime Database

아 EditText를 string으로 변환하려면 .text가 있어야 됐군요..

Written on

·

229

·

Edited

0

customDialogBinding.btnSave.setOnClickListener {


//  여기에서 etMemo.toString으로 썼었습니다.
    val memo = customDialogBinding.etMemo.text.toString()

    val database = Firebase.database
    val myRef = database.getReference("myMemo")

    val model = DataModel(dateText, memo)

    myRef
        .push()
        .setValue(model)
    mAlertDialog.dismiss()
}


editText를 string으로 변환하려면 text를 썼어야됐는데 못봐가지고 그냥 editText.toString하다가

memo=androidx.appcompat.widget.AppCompatEditText{9486c89 VFED..CL. .F...... 53,53-887,211 #7f0901fb app:id/et_memo aid=1073741827}

자꾸 이렇게 파이어베이스에 들어가서 몇시간동안 원인 찾았네요 ㅠㅠ
전전강의까지 가서 다시 분석해보니 답을 찾았습니다 ㅋㅋㅋ
모두 포기하지말고 화이팅 😂

androidkotlinfirebase

Answer 1

0

bokchi님의 프로필 이미지
bokchi
Instructor

파이팅입니다 :)

choidaehwan92822002's profile image
choidaehwan92822002

asked

Ask a question