Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes two issues, but I tested them together to make sure this time everything works as expected.
The fix in make sure MainActivity doesn't hide other activities when launcher icon is clicked again #4813 went into the right direction, but the condition was a bit too broad. When sharing something to Tusky so that Tusky switches accounts, sometimes nothing would happen.
fixes Share to other account leaves UI inbetween two accounts in tusky test #4766. There are two possibilities here (I think it depends mostly on API level):
2a) Sharing starts a new task.
android:maxRecents="1"
makes sure old tasks disappear and are not left in the weird in-between state.3a) Sharing starts a new
MainActivity
in an existing task.Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
makes sure oldMainActivity
instances are removed. On newer Android versions this has the sideeffect of changing the switch animation, but whatever.Basically this gives us the behavior I wanted to achieve with the
android:launchMode="singleTask"
without the unintended side effects.