private void switchUiMode() {
    darkModeEnabled = !darkModeEnabled;
    preferences.edit().putBoolean(KEY_DARK_MODE_ENABLED, darkModeEnabled).commit();
    // Restart the activity to apply new theme. Here we try to remove the fade animation to help
    // users feel the app just do some light refreshing.
    finish();
    overridePendingTransition(0, 0);
    startActivity(new Intent(this, getClass()));
    overridePendingTransition(0, 0);
  }
Invoked when a context menu/action bar item is clicked/tapped.

@return {@code true} if the event was consumed, {@code false} otherwise.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java