Skip to content

MediaPicker - PickPhotosAsync doesn't return on Android when using multiple Activities #35826

@ben-dean

Description

@ben-dean

Description

In net10.0-android apps using multiple activities, PickPhotosAsync does not return when used in a child activity until you return to the main app activity.

The image picker does show and you can select your image, but then it does not return to the calling method.

This used to work until Commit 0c25c62 (0c25c62) which stops the registration of a new activities against ActivityForResultRequest.

This makes the app wait until the main activity is resumed before the selected image is returned.

This used to work on Android and doing a similar in an iOS app still works.

Steps to Reproduce

  • Create an activity that is not the main Activity.
  • Add the implementation for MediaPicker.
  • Call PickPhotosAsync and await the Task.
  • The picker UI will show.
  • Select an image.
  • The task will not return until the current activity is closed and the main activity is returned to.

Link to public reproduction project repository

https://github.com/ben-dean/MediaPicker

Version with bug

10.0.20

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

10.0.11

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infoi/regressionThis issue described a confirmed regression on a currently supported versionpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androidregressed-in-10.0.20s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions