+ override fun onNavigationItemSelected(menuItem: MenuItem) : Boolean {
+ // Get the menu item ID.
+ val menuItemId = menuItem.itemId
+
+ // Run the commands that correspond to the selected menu item.
+ if (menuItemId == R.id.permissions) { // Permissions.
+ // Instantiate the permissions dialog fragment.
+ val permissionsDialogFragment = PermissionsDialog()
+
+ // Show the permissions alert dialog.
+ permissionsDialogFragment.show(supportFragmentManager, getString(R.string.phone_permission))
+ }
+
+ // Close the navigation drawer.
+ drawerLayout.closeDrawer(GravityCompat.START)
+
+ // Consume the click.
+ return true
+ }
+