I get an error message that I cannot wrap around:
I have this simple dialog alert builder in the void method
private void startAction() {
AlertDialog.Builder builder;
builder = new AlertDialog.Builder (this);
var ad = builder.Create ();
builder.SetMessage ("Some text");
builder.SetPositiveButton ("OK", delegate {
ad.Dismiss ();
ShowDialog (0);
});
builder.SetNegativeButton ("Cancel", delegate {
ad.Cancel ();
});
builder.SetCancelable (true);
builder.Show ();
}
Xamarin Insights showed me a crash report (several times) that I cannot reproduce or understand.
System.ArgumentException'jobject' must not be IntPtr.Zero. Parameter name: jobject
Raw
Android.Runtime.JNIEnv.CallVoidMethod(IntPtr jobject, IntPtr jmethod)
Android.App.Dialog.Dismiss()
SpoonacularApp.Droid.ShoppingListActivity.<startAction>c__AnonStorey3.<>m__0(object, DialogClickEventArgs)
Android.Content.IDialogInterfaceOnClickListenerImplementor.OnClick(IDialogInterface dialog, int which)
Android.Content.IDialogInterfaceOnClickListenerInvoker.n_OnClick_Landroid_content_DialogInterface_I(IntPtr jnienv, IntPtr native__this, IntPtr native_dialog, int which)
at (wrapper dynamic-method) System.Object:ba5962df-899a-46fd-a4bd-6c9ffe426b75 (intptr,intptr,intptr,int)
Which argument refers to this exception?
I got the same error message with Android.App.Dialog.Cancel()instead Android.App.Dialog.Dismiss().
source
share