@Override public void onNewIntent(Intent intent) { setIntent(intent); // onNewIntent doesn't autoset our "internal" intent String initialFolder; mUnreadMessageCount = 0; String accountUuid = intent.getStringExtra(EXTRA_ACCOUNT); mAccount = Preferences.getPreferences(this).getAccount(accountUuid); if (mAccount == null) { // This shouldn't normally happen. But apparently it does. See issue 2261. finish(); return; } initialFolder = intent.getStringExtra(EXTRA_INITIAL_FOLDER); boolean fromNotification = intent.getBooleanExtra(EXTRA_FROM_NOTIFICATION, false); if (fromNotification && mAccount.goToUnreadMessageSearch()) { MessagingController.getInstance(getApplication()).notifyAccountCancel(this, mAccount); openUnreadSearch(this, mAccount); finish(); } else if (initialFolder != null && !K9.FOLDER_NONE.equals(initialFolder)) { onOpenFolder(initialFolder); finish(); } else if (intent.getBooleanExtra(EXTRA_FROM_SHORTCUT, false) && !K9.FOLDER_NONE.equals(mAccount.getAutoExpandFolderName())) { onOpenFolder(mAccount.getAutoExpandFolderName()); finish(); } else { initializeActivityView(); } }