How to add click event to item on NavigationView of Android

You have to use OnNavigationItemSelectedListener(MenuItem item) method.

for more check this documentation.

I wanted to make sure the Solution from Nizam can be found in Kotlin to, since it is takeing bigger place every day:

val mDrawerLayout = this.findViewById( as DrawerLayout

val mNavigationView = findViewById<View>( as NavigationView

Handle the navigation items in onCreate like this:

mNavigationView.setNavigationItemSelectedListener { it: MenuItem ->
                when (it.itemId) {
           -> doThis()
          > doThat()
                    else -> {

Remember: Return Type has to be a boolean!

  1. Implement the listener in your Activity:

    public class HomeActivity extends AppCompatActivity implements 
  2. setNavigationItemSelectedListener in onCreate of Activity

    NavigationView mNavigationView = (NavigationView) findViewById(;
    if (mNavigationView != null) {
  3. Override the method

    public boolean onNavigationItemSelected(MenuItem item) {
        // Handle navigation view item clicks here.
        int id = item.getItemId();
        if (id == {
           // DO your stuff