I can report that when a public variable is defined outside the override OnActivityResult and assigned into it, It's value is not valid outside this method.
public static string pippo;
protected override void OnActivityResult (int requestCode, Result resultCode, Intent data)
{
pippo = "what ever you want";
}
button.Click += delegate { if pippo.Lenght > 0 Console.WriteLine("ok");}
BANG! -> Error: Object reference not set for an instance of an object
I'm asking. Why ? Then, which is the right method to have a valid object outside the override method ?
Thanks,
Max.
Errata corrige: this happens for objects. For example a Bitmap. take a look to the last project attached to my previous thread. forums.xamarin.com/discussion/6859/object-reference-not-set-to-an-instance-of-an-object#latest