Skip to content

[Android] MediaPicker gets stuck if LaunchMode is SingleTask #33706

@SigiNeumann

Description

@SigiNeumann

Description

When using the MediaPicker and the MainAcitivity LaunchMode is SingleTask, the MediaPicker can get stuck in "PickPhotoAsync" if app is left via HomeButton.
If app is resumed, in SingleTop Mode, MediaPicker is still visible. In SingleTaskMode MediaPicker is gone an app still stuck in async method.
Videos show diff between the 2 LaunchModes

SingleTask.webm
SingleTop.webm

Steps to Reproduce

Repro works only if LaunchMode is set to SingleTask for MainActivity.
Steps to reproduce:
Build and lauch the app on Android emulator or device.
Click on "Pick Media" button.
Media picker opens.
Leave app via o home button or task switcher.
Go back to the app.
Media picker is gone but the activty indicator is still spinning.
Expected behavior:
Media picker should be dismissed and activity indicator should stopped or
Media picker should be still visible (this is the case if LaunchMode is not SingleTask).

Link to public reproduction project repository

https://github.com/SigiNeumann/MediaPickerRepro

Version with bug

10.0.30

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android

Did you find any workaround?

Do not use LaunchMode SingleTask. Which is not possible for our UC

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    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