package Ġedu . s js u . twitter feeds Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . navigation . find Nav Controller Ċ import Ġandroidx . navigation . ui . AppBar Configuration Ċ import Ġandroidx . navigation . ui . navigate Up Ċ import Ġandroidx . navigation . ui . setup ActionBar With Nav Controller Ċ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġapp bar Config : ĠApp Bar Configuration ĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . main _ activity ) ĊĠĠĠĠĠĠĠ Ġval Ġnavigation Controller Ġ= Ġfind Nav Controller ( R . id . content _ main ) ĊĠĠĠĠĠĠĠ Ġapp bar Config Ġ= ĠApp Bar Configuration ( navigation Controller . graph ) ĊĠĠĠĠĠĠĠ Ġsetup ActionBar With Nav Controller ( navigation Controller , Ġapp bar Config ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġfind Nav Controller ( R . id . content _ main ) ĊĠĠĠĠĠĠĠ Ġreturn Ġnav Controller . navigate Up ( app bar Config ) Ġ|| Ġsuper . on Support Navigate Up () ĊĠĠĠ Ġ} Ċ }