package Ġcom . alo e . moment . business . rn Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . activity . On Back Pressed Callback Ċ import Ġandroidx . navigation . fragment . find Nav Controller Ċ import Ġcom . alo e . moment . base . Base Frag Ċ import Ġcom . alo e . moment . base . Base Vm Ċ Ċ class ĠR n Frag Ġ: ĠBase Frag < Base Vm >() Ġ{ ĊĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView Ġ{ ĊĠĠĠ Ġreturn ĠR n View ( require Context ()) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠ Ġval Ġrn View : Rn View Ġ= Ġview Ġas ĠR n View ĊĠĠĠ Ġrequire Activity (). on Back Pressed Dispatcher . add Callback ( view Lifecycle Owner , Ġobject Ġ: ĠOn Back Pressed Callback ( false ) Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun Ġhandle On Back Pressed () Ġ{ ĊĠĠĠĠĠĠĠ Ġrn View . react Instance Manager ?. on Back Pressed () ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}) ĊĠĠĠ Ġrn View . set Back Btn Handler Ġ{ ĊĠĠĠĠĠ Ġif Ġ( rn View . react Instance Manager Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfind Nav Controller (). pop Back Stack () ĊĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġrn View . react Instance Manager ?. on Back Pressed () ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ}. load Page ( null , Ġnull ) ĊĠ Ġ} Ċ }