Created
October 12, 2020 10:22
-
-
Save Mrnikbobjeff/547b227d25ad4b9c5381f383f14289be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) | |
{ | |
base.OnActivityResult(requestCode, resultCode, data); | |
// we have a valid GUID, so handle the task | |
if (!string.IsNullOrEmpty(guid) && pendingTasks.TryRemove(guid, out var tcs) && tcs != null) | |
{ | |
if (resultCode == Result.Canceled) | |
{ | |
tcs.TrySetCanceled(); | |
} | |
else | |
{ | |
if (resultCode != Result.Ok) | |
{ | |
tcs.SetException(new Exception("Activity returned non-OK result code.")); | |
} | |
if (data != null && outputUri != null) | |
{ | |
data.PutExtra(OutputUriExtra, outputUri); | |
} | |
else if (data == null && outputUri != null) | |
{ | |
data = new AndroidIntent(); | |
data.PutExtra(OutputUriExtra, outputUri); | |
} | |
tcs.TrySetResult(data); | |
} | |
} | |
// close the intermediate activity | |
Finish(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment