File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
owncloud/android/ui/activity Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ object LinkHelper {
4949 if (intent != null ) {
5050 // app installed - open directly
5151 // TODO handle null user?
52- intent.putExtra(FileDisplayActivity .KEY_ACCOUNT , user.hashCode() )
52+ intent.putExtra(FileDisplayActivity .KEY_ACCOUNT , user)
5353 context.startActivity(intent)
5454 } else {
5555 // app not found - open market (Google Play Store, F-Droid, etc.)
Original file line number Diff line number Diff line change @@ -1234,7 +1234,7 @@ private View findQuotaViewById(int id) {
12341234 /**
12351235 * restart helper method which is called after a changing the current account.
12361236 */
1237- private void restart () {
1237+ protected void restart () {
12381238 Intent i = new Intent (this , FileDisplayActivity .class );
12391239 i .addFlags (Intent .FLAG_ACTIVITY_CLEAR_TOP );
12401240 i .setAction (FileDisplayActivity .RESTART );
Original file line number Diff line number Diff line change @@ -600,9 +600,17 @@ class FileDisplayActivity :
600600 OPEN_FILE -> {
601601 onOpenFileIntent(intent)
602602 }
603+ Intent .ACTION_MAIN -> handleSwitchAccount(intent)
603604 }
604605 }
605606
607+ private fun handleSwitchAccount (intent : Intent ) {
608+ val accountName = intent.getStringExtra(KEY_ACCOUNT )
609+ val account = accountManager.getAccountByName(accountName)
610+ setAccount(account, false )
611+ restart()
612+ }
613+
606614 @SuppressLint(" UnsafeIntentLaunch" )
607615 private fun handleRestartIntent (intent : Intent ) {
608616 if (intent.action != RESTART ) {
@@ -1327,6 +1335,8 @@ class FileDisplayActivity :
13271335 override fun onResume () {
13281336 Log_OC .v(TAG , " onResume() start" )
13291337
1338+ handleCommonIntents(intent)
1339+
13301340 super .onResume()
13311341 if (SettingsActivity .isBackPressed) {
13321342 Log_OC .d(TAG , " User returned from settings activity, skipping reset content logic" )
You can’t perform that action at this time.
0 commit comments