Usually with Android, you set an integer result code when setting the result of an activity as shown here:
void setResult(int resultCode)
Xamarin, instead, requires an enum defined as Android.App.Result
.
This enum has these values:
Ok,
Canceled,
FirstUser
The Problem
You cannot set custom result codes in Xamarin Android. FirstUser is supposed to define the first safe custom result for the user to use. i.e, any integer greater than the value of FirstUser is fine to use as stated here in the Android docs.
I am forced to set the result code as this enum type. Is there a way around this? The OnActivityResult
method also uses this enum.
protected override void OnActivityResult(int requestCode, Android.App.Result resultCode, Intent data)