인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

sm13740441's profile image
sm13740441

asked

Modern Android - Using Kotlin and Jetpack

Fragment -> Fragment data passing (FragmentResult API)

setFragmentResultListener 객체를 받는방법은 없나요?

Written on

·

249

0

A 라는 data class를 넘겨주고 싶어서 이렇게 써봤는데 null 이 나오더라구요.. string으로 하나하나 넘겨주면되긴하던데 

data class 에 serializable도 썼는데 넘겨줄방법이없는건가요?

setFragmentResultListener("item") { resultKey, bundle ->
val test = bundle.getBundle("data")
Log.e("tag", "뭐야 "+ test)
}
kotlinandroidjetpack

Answer 1

0

survivalcoding님의 프로필 이미지
survivalcoding
Instructor

bundle에서 Serializable 객체를 얻을 때는 bundle.getSerializable("data") 하시면 될 것 같습니다.

sm13740441's profile image
sm13740441

asked

Ask a question