Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,11 @@ public void onMessageEvent(DummyDrawerEvent event) {

private void onNavigationItemClicked(final MenuItem menuItem) {
int itemId = menuItem.getItemId();
menuItemId = itemId;

if (itemId != R.id.nav_settings) {
menuItemId = itemId;
}

setNavigationViewItemChecked();

if (itemId == R.id.nav_all_files || itemId == R.id.nav_personal_files) {
Expand Down Expand Up @@ -602,13 +606,7 @@ private void onNavigationItemClicked(final MenuItem menuItem) {
startActivity(ActivitiesActivity.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
} else if (itemId == R.id.nav_settings) {
resetOnlyPersonalAndOnDevice();

/**
* Since pressing the back button in SettingsActivity always returns to the all file list, we can clear the stack.
* {@link SettingsActivity#onBackPressed()
*/
final Intent intent = new Intent(this, SettingsActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
} else if (itemId == R.id.nav_community) {
resetOnlyPersonalAndOnDevice();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.owncloud.android.ui.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -358,16 +357,6 @@ private void setupAboutCategory(String appVersion) {
}
}

@SuppressLint("GestureBackNavigation")
@Override
public void onBackPressed() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to override the back press behavior, since the back press will handle itself and display whatever is in the stack.

DrawerActivity.menuItemId = R.id.nav_all_files;
Intent i = new Intent(this, FileDisplayActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
i.setAction(FileDisplayActivity.ALL_FILES);
startActivity(i);
}

private void setupSyncCategory() {
final PreferenceCategory preferenceCategorySync = (PreferenceCategory) findPreference("sync");
viewThemeUtils.files.themePreferenceCategory(preferenceCategorySync);
Expand Down Expand Up @@ -1056,8 +1045,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
handleMnemonicRequest(data);
} else if (requestCode == ACTION_E2E && data != null && data.getBooleanExtra(SetupEncryptionDialogFragment.SUCCESS, false)) {
Intent i = new Intent(this, SettingsActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't clear stack so that we can go back from SettingsActivity

i.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(i);
} else if (requestCode == ACTION_SET_STORAGE_LOCATION && data != null) {
String newPath = data.getStringExtra(ChooseStorageLocationActivity.KEY_RESULT_STORAGE_LOCATION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ class BackupFragment :
contactsPreferenceActivity.finish()
} else {
val settingsIntent = Intent(context, SettingsActivity::class.java)
settingsIntent.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't clear stack so that we can go back from SettingsActivity

startActivity(settingsIntent)
}
return true
Expand Down
Loading