-
Notifications
You must be signed in to change notification settings - Fork 223
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
Change launchMode on MainActivity from "singleTop" to "singleTask" #3126
Conversation
singleTask looks a more correct launchMode for the MainActivity
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in 📱 Mobile by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in 🚗 Automotive by scanning the QR code below to install the corresponding build.
📲 You can test the changes from this Pull Request in ⌚ Wear by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this breaks the app. When a different activity is on top minimizing the app and then opening the app again collapses the activity stack to the MainActivity
. In the attached video you can see that. The Upsell screen disappears after I reopen the active application either by tapping on the app's icon, on a widget, or on a media notification. This happens with other activities as well.
screen-20241030-083226.mp4
Thanks for the testing @MiSikora! I've been reading, and investigating about that. It seems to be the expected behavior when using the Some people suggest some workarounds that consist of not using the Said that, I think we shouldn't move forward with this change. PocketCast is working well and create a new activity with the suggested workarounds just to change the launch mode of the |
Yes, I agree we shouldn't merge it when it results in this behavior. Honestly the only real solution that I know of is using a single activity but this is not currently feasible. |
Anyway, thanks for you help @MiSikora! |
Description
Looking at the Android documentation, it seems like the
singleTask
launchMode
is more correct to the Gravatar'sMainActivity
.vs
Despite being just a one-line change, please smoke test everything that comes to your mind related to how the activity is launched. I've done the same, but I have limited knowledge of the code base.
cc: @MiSikora
Testing Instructions
Checklist
- [ ] If this is a user-facing change, I have added an entry in CHANGELOG.md- [] Ensure the linter passes (./gradlew spotlessApply
to automatically apply formatting/linting)- [ ] I have considered whether it makes sense to add tests for my changes- [ ] All strings that need to be localized are inmodules/services/localization/src/main/res/values/strings.xml
- [ ] Any jetpack compose components I added or changed are covered by compose previews- [ ] I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.I have tested any UI changes...
- [ ] with different themes- [ ] with a landscape orientation- [ ] with the device set to have a large display and font size- [ ] for accessibility with TalkBack