Bottom navigation
Step 1. Add Framelayout in Layout File
Step 2. Create fragment in android studio for your app
Step 3. How to use fragmentmanager to use fragment in your app
Load fragment in app on BottomNavigationView event
Steps1. create new fragment->fragment blank of h fragment.kt and another of create aboutfragment.kt
Step2. fragment_home_xml-> attributes-> text-> I am home fragment
Step3. fragment_about_xml-> attributes-> text-> I am about fragment
Go to MainActivity.kt (code)
supportFragmentManager.begin Transaction ().add(R.id.root_container,HomeFragment()).commit()
Bottomview.setOnNavigationItemSelectedListener(
/*Part one logic
Val msg= when(it.itemID)
{
R.id.about->”About Selected”
else ->”Home selected”
}
Toast.make text(this @MainActivity,msg,Toast.LENGTH_LONG).show() /*
Val fragment=when(it.itemId)
{
R.id.about->AboutFragment()
else->HomeFragment ()
}
SupportFragmentManager.begin Transaction ().replace(R.id. root_container, fragment).commit()
True
}
}
}
Fabulous, what a webpage it is! This webpage presents useful information to us, keep it up. Corissa Wait Rosalynd
Absolutely composed written content , thanks for information . Carola Micky Xanthus
Hello colleagues, how is all, and what you wish for to say regarding this article, in my view its genuinely remarkable in favor of me. Dollie Rafe Vanni
I real happy to find this web site on bing, just what I was looking for : D besides saved to favorites. Millicent Lezley Diao
I go to see everyday some sites and sites to read content, except this weblog presents quality based articles. Octavia Igor Liu
Well I truly enjoyed studying it. This information provided by you is very helpful for correct planning. Evonne Tyson Bartolemo
Well I really enjoyed reading it. This tip procured by you is very effective for correct planning. Karoly Elroy Gothart
Good article! We will be linking to this great post on our website. Keep up the good writing. Alison Ara Raybin
This piece of writing provides clear idea designed for the new visitors of blogging, that genuinely how to do blogging and site-building. Vally Benjamin Rather
There is certainly a lot to find out about this topic. Vilhelmina Artie Jade
I am genuinely grateful to the holder of this website who has shared this impressive post at here. Robinetta Sanford Matteo
I think this is a real great blog post. Fantastic. Moselle Ethelbert Lash
Some genuinely superb blog posts oon this website, thank you for contribution. Kirstin Dev Varipapa
Excellent article. I will be facing some of these issues as well.. Gerta Huntington Leonie
I appreciate, lead to I discovered just what I was taking a look for. Candy Pavlov Dilks
Howdy very nice website!! Man .. Beautiful .. Amazing .. Zena Rube Matthiew