1. 디팬던시 추가
implementation("androidx.fragment:fragment-ktx:1.3.6")
2. 보내는 프래그먼트
setFragmentResult(
"movePin",
bundleOf("data" to "hisungwoo")
)
bundelOf : 번들 간단히 만드는 함수
3. 데이터 받는 프래그먼트에서 리스너 작성
setFragmentResultListener("requestKey") {requestKey, bundle->
val data = bundle.getString("data", "")
}
'기술적용' 카테고리의 다른 글
키보드 컨트롤 (0) | 2022.03.18 |
---|---|
Recyclerview 구현 (0) | 2022.03.17 |
LiveData 구현 (0) | 2022.03.16 |
ViewModel 적용 (0) | 2022.03.15 |
Room 구성하기 (0) | 2022.03.15 |