setNavigationItemSelectedListener Not Working

I had the same problem, and I discovered that Android is VERY particular about the layout XML. I had my NavigationView as the first child of the DrawerLayout, but it has to be the last child for some stupid reason. So your layout must have the elements in this order:

<DrawerLayout>
    <FrameLayout/>
    <NavigationView/>
</DrawerLayout>

NOT in this order:

<DrawerLayout>
    <NavigationView/>
    <FrameLayout/>
</DrawerLayout>

Leave a Comment