0
나는 다음과 같은 코드가 있습니다에 AlertDialog가 .show에 표시되지 않는() - 자 마린 안드로이드
private void CloseOrder(object sender, EventArgs e)
{
Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
alert.SetTitle("Cerrar Pedido");
alert.SetMessage("Are you sure?");
alert.SetCancelable(true);
alert.SetPositiveButton("Confirm", delegate { this.Rta = true; });
alert.SetNegativeButton("Cancel", delegate { this.Rta = false; });
Dialog dialog = alert.Create();
dialog.Show();
if (this.Rta)
{
//Some code here
}
}
this.Rta 내 클래스의 속성입니다.
문제는 dialog.show()
에 경고가 표시되지 않으며 CloseOrder()
메서드가 끝났을 때 표시된다는 것입니다. 따라서 this.Rta
에는 해당 값이 할당되지 않습니다.
많은 검색을 해왔지만 해결책을 찾지 못했습니다. 아무도 도와 줄 수 없다면 위대 할 수 있습니다.