package Ġjp . co . yu mem i . send a . binding example . ui . test Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . util . Log Ċ import Ġandroid . view . View Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . fragment . app . activity ViewModels Ċ import Ġjp . co . yu mem i . send a . binding example . R Ċ import Ġjp . co . yu mem i . send a . binding example . databinding . Fragment Problem Binding Ċ Ċ /** Ċ Ġ* Ġ@ author ĠSe o - 4 d 6 9 6 b 7 5 Ċ Ġ* Ġ@ version Ġ 2 0 2 1 / 1 0 / 1 1 . Ċ Ġ*/ Ċ class ĠProblem Fragment Ġ: ĠFragment ( R . layout . fragment _ problem ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval ĠviewModel Ġby Ġactivity ViewModels < Test ViewModel >() ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠFragment Problem Binding ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠFragment Problem Binding . bind ( view ) ĊĠĠĠĠĠĠĠ Ġbinding . viewModel Ġ= ĠviewModel ĊĠĠĠĠĠĠĠ Ġbinding . lifecycle Owner Ġ= Ġview Lifecycle Owner ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy View () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy View () ĊĠĠĠĠĠĠĠ ĠLog . d (" Problem Fragment ", Ġ" on Destroy View ") ĊĠĠĠ Ġ} Ċ } Ċ