Navigation Drawer with Fragments Part 3 – HANDLING MENU ITEM CLICKS – Android Studio Tutorial
In part 3 of the navigation drawer tutorial, we will create 3 fragments and their corresponding layout files. Then we implement the OnNavigationItemSelectedListener interface into our MainActivity and set it as the listener on our NavigationView to handle click events on our menu items. For our 3 main items we will open the corresponding fragment with the getSupportFragmentManager and beginTransaction methods, and for the other 2 items we will simply show a toast message.
Watch the whole playlist:
Example code + dependency:
____________________
❗ Subscribe to the channel:
https://www.youtube.com/c/codinginflow?sub_confirmation=1
⏯ Watch more tutorials:
https://www.youtube.com/c/codinginflow/playlists
㊙ Help translating the videos:
http://www.youtube.com/timedtext_cs_panel?c=UC_Fh8kvtkVPkeihBs42jGcA&tab=2
💚 Support the content:
💬 Join the Discord chat:
https://discord.gg/TSnMvmc
🎧 Audiobooks and podcasts for programmers:
5 Audiobooks and Podcasts That Help You Become a Better Programmer While Washing the Dishes
👶 How to get started with Android development:
📣 Follow Coding in Flow on social media:
Facebook:
https://www.facebook.com/codinginflow
Instagram:
https://www.instagram.com/codinginflow
Twitter:
Tweets by codinginflow
Blog:
https://codinginflow.com
source