Skip to content

[Android] Fixed: Image randomly disappears while switching tabs #30763

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Tamilarasan-Paranthaman
Copy link
Contributor

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman commented Jul 22, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Root Cause of the issue

  • The CompleteLoad() method is not invoked in the reported scenario on the Android platform. As a result, the condition imageHandler.SourceLoader.SourceManager.IsLoading, introduced in PR #28405, is not properly reset on Android. This appears to be the root cause of the issue.

Description of Change

  • The CompleteLoad() method is now called uniformly across all platforms.

  • Initially, CompleteLoad() was called for all platforms.

  • Later, in PR #16864, the logic was adjusted to handle blurry FontImageSource icons on iOS. As part of that change, the condition was split between iOS & Windows and Android & Tizen. However, it seems the CompleteLoad() call was mistakenly omitted for Android.

Issues Fixed

Fixes #30728

Tested the behaviour in the following platforms

  • Android
  • iOS
  • Mac
  • Windows

Screenshot

Before Fix After Fix
Before-Fix.mov
After-Fix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 22, 2025
Copy link
Contributor

Hey there @@Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 22, 2025
@bhavanesh2001
Copy link
Contributor

cc @albyrock87

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review July 23, 2025 07:53
@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 07:53
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner July 23, 2025 07:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue on Android where images would randomly disappear when switching between tabs. The root cause was that the CompleteLoad() method wasn't being called on Android, preventing the IsLoading state from being properly reset in the image source manager.

Key changes:

  • Added missing CompleteLoad() call for Android platform in ImageSourcePartLoader.cs
  • Restored platform parity by ensuring all platforms properly complete the loading process

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added the p/0 Work that we can't release without label Jul 23, 2025
@PureWeen PureWeen added this to the .NET 9 SR10 milestone Jul 23, 2025
@albyrock87
Copy link
Contributor

I tested CI packages and I can confirm it fixes the issue.

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Jul 25, 2025
@PureWeen
Copy link
Member

/azp run

@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Jul 25, 2025
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/backport to release/9.0.1xx-sr9

Copy link
Contributor

Started backporting to release/9.0.1xx-sr9: https://github.com/dotnet/maui/actions/runs/16530674834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution p/0 Work that we can't release without partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

[Android] Image randomly disappears while switching tabs due to a race condition
4 participants