Changed order of calls to properly close MediaPicker Activity / ViewController and set the picker result #21998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes this issue Alex-Dobrynin/Xamarin.Controls.ImageCropper#8
Shortly, at the moment of getting the result of mediapicker, the activity or viewcontroller remains opened. And if open another activity or viewcontroller right after the result of mediapicker you will not see any new activity/viewcontroller opened. So to fix this we need to change the order of calls: 1. we need to close activity/viewcontroller, 2. we need to set the result of mediapicker
Actual result: we need to put some Task.Delay after mediapicker result to be able open new activity/viewcontroller
Expected result: we able to open new activity/viewcontroller right after getting the picker result.
To reproduce it, you can try open new activity or viewcontroller from the topmost one (which is still mediapicker's activity/viewcontrolelr) right after the mediapicker result.
Affects only android/ios