package Ġcom . example . my browser 2 Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġcom . google . android . material . bottomnavigation . Bottom Navigation View Ċ import Ġandroidx . fragment . app . Fragment Activity Ċ import Ġandroidx . navigation . find Nav Controller Ċ import Ġandroidx . navigation . ui . setup With Nav Controller Ċ Ċ class ĠMainActivity Ġ: ĠFragment Activity () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĠĠĠĠĠĠĠ Ġval Ġnav View : ĠBottom Navigation View Ġ= ĠfindViewById ( R . id . nav _ view ) ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġfind Nav Controller ( R . id . nav _ host _ fragment ) ĊĠĠĠĠĠĠĠ Ġnav View . setup With Nav Controller ( nav Controller ) ĊĠĠĠ Ġ} Ċ } Ċ