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:

Part 3 – Fragments

____________________
❗ 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:

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:

How to Learn Android Development as a Complete Beginner

📣 Follow Coding in Flow on social media:

Facebook:
https://www.facebook.com/codinginflow

Instagram:
https://www.instagram.com/codinginflow

Twitter:

Blog:
https://codinginflow.com

source

Reply


Build A Site Info