inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của wlsdyd68592674

wlsdyd68592674 wlsdyd68592674

@wlsdyd68592674

Số lượng đánh giá đã viết
1
Xếp hạng trung bình
5.0

Bài viết 5

Hỏi & Đáp

Fragment UserViewFragment{755083c (97350660-0d15-4791-b814-9fd04e9c5cc3)} not attached to a context 오류문의

저는 override fun onDestroy () { super . onDestroy () registration !!. remove () } 이렇게 사용하고 있습니다~ 액티비티나 프래그먼트의 생애주기에 따라 화면이 사라지는 부분에서 remove를 해주면 됩니다 registration은 var registration : ListenerRegistration ? = null 이렇게 전역으로 선언하고 스냅샷으로 사용하면 됩니다 registration = firestore !!. collection ( "reunions" ). document ( reunionUid ). addSnapshotListener { value , error -> if ( value == null ) return @addSnapshotListener reunionDTO = value . toObject ( ReunionDTO :: class . java )! }

Lượt thích
2
Số bình luận
7
Lượt xem
532

Hỏi & Đáp

완강했습니다!

감사합니다!

Lượt thích
0
Số bình luận
2
Lượt xem
228