when (item.itemId) { R.id.nav_elemento1 -> { Toast.makeText(this, "Elemento 1", Toast.LENGTH_SHORT).show() } R.id.nav_elemento2 -> { Toast.makeText(this, "Elemento 2", Toast.LENGTH_SHORT).show() } } val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) drawerLayout.closeDrawer(GravityCompat.START) return true