Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix MainActivity behavior #4818

Merged
merged 2 commits into from
Dec 21, 2024
Merged

fix MainActivity behavior #4818

merged 2 commits into from
Dec 21, 2024

Conversation

connyduck
Copy link
Collaborator

@connyduck connyduck commented Dec 21, 2024

This fixes two issues, but I tested them together to make sure this time everything works as expected.

  1. 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.

  2. 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 old MainActivity 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.

@connyduck connyduck requested review from Tak and charlag December 21, 2024 08:39
@connyduck connyduck merged commit dee1767 into develop Dec 21, 2024
1 check passed
@connyduck connyduck deleted the fix-main-activity-behavior branch December 21, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Share to other account leaves UI inbetween two accounts in tusky test
2 participants