Bottom navigation part 2 in Android using Kotlin:

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 
}
}
}

16 thoughts on “Bottom navigation part 2 in Android using Kotlin:”

  1. john wick

    December 10, 2020

    Fabulous, what a webpage it is! This webpage presents useful information to us, keep it up. Corissa Wait Rosalynd

    Reply
  2. porno

    December 15, 2020

    Absolutely composed written content , thanks for information . Carola Micky Xanthus

    Reply
  3. sikis

    December 18, 2020

    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

    Reply
  4. sikis

    December 18, 2020

    I real happy to find this web site on bing, just what I was looking for : D besides saved to favorites. Millicent Lezley Diao

    Reply
  5. sikis

    December 18, 2020

    I go to see everyday some sites and sites to read content, except this weblog presents quality based articles. Octavia Igor Liu

    Reply
  6. web-dl

    December 20, 2020

    Well I truly enjoyed studying it. This information provided by you is very helpful for correct planning. Evonne Tyson Bartolemo

    Reply
  7. yify

    December 20, 2020

    Well I really enjoyed reading it. This tip procured by you is very effective for correct planning. Karoly Elroy Gothart

    Reply
  8. bedava

    December 20, 2020

    Good article! We will be linking to this great post on our website. Keep up the good writing. Alison Ara Raybin

    Reply
  9. yify

    December 20, 2020

    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

    Reply
  10. bluray

    December 21, 2020

    There is certainly a lot to find out about this topic. Vilhelmina Artie Jade

    Reply
  11. ucretsiz

    December 21, 2020

    I am genuinely grateful to the holder of this website who has shared this impressive post at here. Robinetta Sanford Matteo

    Reply
  12. yify

    December 21, 2020

    I think this is a real great blog post. Fantastic. Moselle Ethelbert Lash

    Reply
  13. indir

    December 21, 2020

    Some genuinely superb blog posts oon this website, thank you for contribution. Kirstin Dev Varipapa

    Reply
  14. bluray

    December 22, 2020

    Excellent article. I will be facing some of these issues as well.. Gerta Huntington Leonie

    Reply
  15. bluray

    December 22, 2020

    I appreciate, lead to I discovered just what I was taking a look for. Candy Pavlov Dilks

    Reply
  16. indir

    December 23, 2020

    Howdy very nice website!! Man .. Beautiful .. Amazing .. Zena Rube Matthiew

    Reply

Want to say something? Post a comment

Your email address will not be published. Required fields are marked *