Skip to content

Comments

fix(SharedDecks): Fix freeze when cancelling download#20082

Merged
BrayanDSO merged 1 commit intoankidroid:mainfrom
Ayush-Patel-56:fix-cancel-download-freeze
Jan 15, 2026
Merged

fix(SharedDecks): Fix freeze when cancelling download#20082
BrayanDSO merged 1 commit intoankidroid:mainfrom
Ayush-Patel-56:fix-cancel-download-freeze

Conversation

@Ayush-Patel-56
Copy link
Contributor

Purpose / Description

Fixes #20077

The download screen was freezing when I clicked "Cancel" passing "Yes".
It seems onBackPressed() wasn't reliably closing the screen.

Fixes

I replaced onBackPressed() with popBackStack(). This makes sure the fragment is removed immediately.

Approach

I verified this on the emulator and the freeze is gone.

screen-20260112-113552.2.mp4

Use popBackStack() instead of onBackPressed() to properly close the fragment.

Fixes ankidroid#20077
@david-allison
Copy link
Member

Cheers!

It seems onBackPressed() wasn't reliably closing the screen.

Why?

@Ayush-Patel-56
Copy link
Contributor Author

Cheers!

It seems onBackPressed() wasn't reliably closing the screen.

Why?

In the listener we disable the callback then immediately call onBackPressed. I think the dispatcher doesn't pick up the change fast enough so it ignores the call. popBackStack works better because it just removes the fragment directly.

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Jan 12, 2026
@BrayanDSO BrayanDSO added this pull request to the merge queue Jan 15, 2026
@BrayanDSO BrayanDSO added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Jan 15, 2026
Merged via the queue into ankidroid:main with commit ea32c22 Jan 15, 2026
19 checks passed
@github-actions github-actions bot added this to the 2.24 release milestone Jan 15, 2026
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jan 15, 2026
@Ayush-Patel-56 Ayush-Patel-56 deleted the fix-cancel-download-freeze branch January 15, 2026 15:29
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.

[BUG] Shared Deck Download: 'Cancel' does not seem responsive

3 participants