In this video you will learn, how to add a bottom navigation to your activity and use it to switch between different fragments. We will fill our BottomNavigationView …




  1. Coding in Flow Reply

    If your project is using AndroidX dependencies, add this new dependency instead of the design support library: implementation ''
    If you want to keep the selected fragment when rotating the device, make the following little change to the code:

    Surround the fragment transaction in the onCreate method with an if/else statement like this (I also changed the code on my website):

    if (savedInstanceState == null) {
    new HomeFragment()).commit();

  2. 주주jujutham Reply

    Sir, could you please explain how to add buttons on viewmodel class?

  3. ساره الجريد Reply

    why it's not working for me on existing project ?

  4. syed shoaib Reply

    I cant find any bottomNavigationView Widget what should I do

  5. Blue Kaioken Reply

    Great Video!!!, very good guiding, explaining and showing, I have a question, do you know how to prevent fragments to refresh on tab changing ? I haven't seen a good tutorial for it, whatever I find online does not work or doesn't explain thoroughly. Thanks in advance.

  6. Matias Tactoc Reply

    How to find buttons or items from MainActivity please help

  7. Frederyk Linhares Reply

    Wow! Straightforward to the point! Congratulations! Very very good tutorial!

  8. Thamizhan Thiru Reply

    Error:Failed to resolve:androidx.appcompat:design:1.1.0

    Please Hlp me Sir…!!!!

  9. Martín Pe'C Reply

    Hi, thanks a lot, really helped

    I just have a question, how can you override the pending transition between the fragments?… I've tried the usual instruction but it doesn't work. Thanks again.

  10. sushmitha prasana Reply

    hi really super your explaination… i quickly grasp your class.. and your voice is super and nice to hear…thank u

  11. Jay Khandelwal Reply

    The following classes could not be instantiated:


  12. Róbert Katona Reply

    i am new to android development and this tutorial was super helpful!
    thank you!

  13. Sport fitness Reply

    implementation ''

  14. Ana Aguilar Reply

    is there an easy way to figure out what in the world we have to implement depending on the version we are using? I don't know why I am having problems with this, I can't find a simple straight up answer on google or seems like the answer should be clear. I have tried so many implementations and they are wrong.

  15. Venkatesh Chowdary Reply

    I used your code in my project like how you done. But the problem is when I start clicking from 4th tab to any other tab anonymously the bottom navigation bar gets pushed down.

Write A Comment