mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Switch accounts on intent
Signed-off-by: ZetaTom <70907959+ZetaTom@users.noreply.github.com>
This commit is contained in:
parent
88a5884b26
commit
6a07bac0eb
2 changed files with 5 additions and 4 deletions
|
@ -371,7 +371,7 @@ public abstract class DrawerActivity extends ToolbarActivity
|
|||
Intent intent = getPackageManager().getLaunchIntentForPackage(packageName);
|
||||
if (intent != null) {
|
||||
// app installed - open directly
|
||||
intent.putExtra(FileDisplayActivity.KEY_ACTIVE_USER, getUser().get().hashCode());
|
||||
intent.putExtra(FileDisplayActivity.KEY_ACCOUNT, getUser().get().hashCode());
|
||||
startActivity(intent);
|
||||
} else {
|
||||
// app not found - open market (Google Play Store, F-Droid, etc.)
|
||||
|
|
|
@ -191,7 +191,6 @@ public class FileDisplayActivity extends FileActivity
|
|||
public static final String KEY_FILE_ID = "KEY_FILE_ID";
|
||||
public static final String KEY_FILE_PATH = "KEY_FILE_PATH";
|
||||
public static final String KEY_ACCOUNT = "KEY_ACCOUNT";
|
||||
public static final String KEY_ACTIVE_USER = "KEY_ACTIVE_USER";
|
||||
|
||||
|
||||
private static final String KEY_WAITING_TO_PREVIEW = "WAITING_TO_PREVIEW";
|
||||
|
@ -392,6 +391,10 @@ public class FileDisplayActivity extends FileActivity
|
|||
if (OPEN_FILE.equals(getIntent().getAction())) {
|
||||
getSupportFragmentManager().executePendingTransactions();
|
||||
onOpenFileIntent(getIntent());
|
||||
} else if (RESTART.equals(getIntent().getAction())) {
|
||||
// most likely switched to different account
|
||||
DisplayUtils.showSnackMessage(this, String.format(getString(R.string.logged_in_as),
|
||||
accountManager.getUser().getAccountName()));
|
||||
}
|
||||
|
||||
upgradeNotificationForInstantUpload();
|
||||
|
@ -2505,8 +2508,6 @@ public class FileDisplayActivity extends FileActivity
|
|||
} else {
|
||||
dismissLoadingDialog();
|
||||
accountClicked(optionalUser.get().hashCode());
|
||||
DisplayUtils.showSnackMessage(this, String.format(getString(R.string.logged_in_as),
|
||||
optionalUser.get().getAccountName()));
|
||||
}
|
||||
} else {
|
||||
dismissLoadingDialog();
|
||||
|
|
Loading…
Reference in a new issue