-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: Single review activity instance #17036
fix: Single review activity instance #17036
Conversation
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.
Thank you very much.
As a user of shortcut, it'll certainly improve my experience!
And it'll allow us to enable the deck picker widget of @xenonnn4w , I think, so that's cool!
Thanks, looks great🌸 |
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.
There is a lack of consistency in our Intent back stack management
https://github.com/search?q=repo%3Aankidroid%2FAnki-Android+Intent.FLAG_ACTIVITY_CLEAR&type=code
...shows we use CLEAR_TASK sometimes, an or
if flags other times, and CLEAR_TOP other times
I believe this is sufficient and an improvement here, so I'm approving this PR
But it looks like there should be a low-priority issue to look at:
- any case where we create an Intent to start an activity
- ...to verify that we are actually using the correct back stack management flags
Fixes
Purpose / Description
This fixes the issue where the error message "Not at top of the queue" appears when a review is in progress and the user opens another deck through the deck picker widget or a deck shortcut. The message appears when attempting to review a card after using the back button on the first deck which takes the user to a deck 'underneath' it. There should not be multiple review activity instances and so restricting there to be only a single review instance on the activity stack removes the possiblity of the "Not at top of the queue" error message occuring.
Intent.FLAG_ACTIVITY_CLEAR_TOP docs:
deck-shortcut-single-activity.webm