Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app/src/main/java/com/nextcloud/utils/LinkHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object LinkHelper {
if (intent != null) {
// app installed - open directly
// TODO handle null user?
intent.putExtra(FileDisplayActivity.KEY_ACCOUNT, user.hashCode())
intent.putExtra(FileDisplayActivity.KEY_ACCOUNT, user)
context.startActivity(intent)
} else {
// app not found - open market (Google Play Store, F-Droid, etc.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ private View findQuotaViewById(int id) {
/**
* restart helper method which is called after a changing the current account.
*/
private void restart() {
protected void restart() {
Intent i = new Intent(this, FileDisplayActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.setAction(FileDisplayActivity.RESTART);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,17 @@ class FileDisplayActivity :
OPEN_FILE -> {
onOpenFileIntent(intent)
}
Intent.ACTION_MAIN -> handleSwitchAccount(intent)
}
}

private fun handleSwitchAccount(intent: Intent) {
val accountName = intent.getStringExtra(KEY_ACCOUNT)
val account = accountManager.getAccountByName(accountName)
setAccount(account, false)
restart()
}

@SuppressLint("UnsafeIntentLaunch")
private fun handleRestartIntent(intent: Intent) {
if (intent.action != RESTART) {
Expand Down Expand Up @@ -1327,6 +1335,8 @@ class FileDisplayActivity :
override fun onResume() {
Log_OC.v(TAG, "onResume() start")

handleCommonIntents(intent)

super.onResume()
if (SettingsActivity.isBackPressed) {
Log_OC.d(TAG, "User returned from settings activity, skipping reset content logic")
Expand Down
Loading