package Ġcom . jon areas . rent app . views . login Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . navigation . Nav Controller Ċ import Ġandroidx . navigation . find Nav Controller Ċ import Ġandroidx . navigation . fragment . Nav Host Fragment Ċ import Ġandroidx . navigation . ui . AppBar Configuration Ċ import Ġandroidx . navigation . ui . navigate Up Ċ import Ġandroidx . navigation . ui . setup ActionBar With Nav Controller Ċ import Ġcom . jon areas . rent app . R Ċ import Ġcom . jon areas . rent app . databinding . Activity Login Binding Ċ Ċ class ĠLogin Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding Ġ: ĠActivity Login Binding ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġapp Bar Configuration Ġ: ĠApp Bar Configuration ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnav Controller Ġ: ĠNav Controller ĊĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠActivity Login Binding . inflate ( layout Inflater ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĊĠĠĠĠĠĠĠ Ġnav Controller Ġ= Ġ( support FragmentManager . find Fragment ById ( R . id . nav _ fragment _ login ) Ġas ĠNav Host Fragment ). nav Controller ĊĊĠĠĠĠĠĠĠ Ġ// ĠTop - level ĠDest inations ĊĠĠĠĠĠĠĠ Ġapp Bar Configuration Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠApp Bar Configuration ( set Of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠR . id . navigation _ on _ launch ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ)) ĊĊĠĠĠĠĠĠĠ Ġsetup ActionBar With Nav Controller ( nav Controller Ġ= Ġnav Controller , Ġconfiguration Ġ= Ġapp Bar Configuration ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ Ġ= Ġnav Controller . navigate Up ( app Bar Configuration ) Ġ|| Ġsuper . on Support Navigate Up () ĊĊĊĊĊ Ċ }