package Ġcom . iz et tle . w rench Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . navigation . Nav Controller Ċ import Ġandroidx . navigation . find Nav Controller Ċ import Ġandroidx . navigation . ui . Navigation UI Ċ import Ġandroidx . navigation . ui . setup ActionBar With Nav Controller Ċ import Ġkotlinx . android . synt hetic . main . activity _ main .* ĊĊ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnav Controller : ĠNav Controller ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĊĠĠĠĠĠĠĠ Ġset Support ActionBar ( bottom AppBar ) ĊĊĠĠĠĠĠĠĠ Ġnav Controller Ġ= Ġfind Nav Controller ( R . id . nav _ host _ fragment ) ĊĊĠĠĠĠĠĠĠ Ġsetup ActionBar With Nav Controller ( nav Controller , Ġdrawer Layout ) ĊĊĠĠĠĠĠĠĠ ĠNavigation UI . setup With Nav Controller ( nav _ view , Ġnav Controller ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ= ĠNavigation UI . navigate Up ( nav Controller , Ġdrawer Layout ) Ċ Ċ } Ċ