package Ġcom . on ur bar man . in vious g challenge . ui Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . navigation . Nav Controller Ċ import Ġandroidx . navigation . fragment . Nav Host Fragment Ċ import Ġandroidx . navigation . fragment . find Nav Controller Ċ import Ġandroidx . navigation . ui . setup ActionBar With Nav Controller Ċ import Ġcom . on ur bar man . in vious g challenge . R Ċ import Ġcom . on ur bar man . in vious g challenge . databinding . Activity Main Binding Ċ import Ġdagger . h ilt . android . Android EntryPoint ĊĊ Ċ @ Android EntryPoint Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnav Controller : ĠNav Controller ĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġval Ġbinding Ġ= ĠActivity Main Binding . inflate ( LayoutInflater . from ( this )) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĠĠĠĠĠĠĠ Ġset Support ActionBar ( binding . toolbar ) ĊĊĠĠĠĠĠĠĠ Ġval Ġnav Host Fragment Ġ= Ġsupport FragmentManager . find Fragment ById ( R . id . nav _ host _ fragment ) Ġas ĠNav Host Fragment ĊĠĠĠĠĠĠĠ Ġnav Controller Ġ= Ġnav Host Fragment . find Nav Controller () ĊĠĠĠĠĠĠĠ Ġset Support ActionBar ( binding . toolbar ) ĊĠĠĠĠĠĠĠ Ġsetup ActionBar With Nav Controller ( nav Controller ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġnav Controller . navigate Up () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ|| Ġsuper . on Support Navigate Up () ĊĠĠĠ Ġ} Ċ }