package Ġcom . med ie ver one . test star w ars api Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . os . Persist able Bundle Ċ import Ġandroid . util . Log Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . navigation . Nav Controller Ċ import Ġandroidx . navigation . Navigation Ċ import Ġandroidx . navigation . fragment . Nav Host Fragment Ċ import Ġandroidx . navigation . fragment . find Nav Controller Ċ import Ġcom . med ie ver one . test star w ars api . databinding . Activity Main Binding Ċ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġnav Controller : ĠNav Controller ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠActivity Main Binding ĊĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠActivity Main Binding . inflate ( layout Inflater ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĠĠĠĠĠĠĠ Ġval Ġnav Host Fragment Ġ= Ġsupport FragmentManager . find Fragment ById ( R . id . main Nav Host Fragment ) Ġas ĠNav Host Fragment ĊĠĠĠĠĠĠĠ Ġnav Controller Ġ= Ġnav Host Fragment . nav Controller ĊĠĠĠ Ġ} Ċ }