I use this code to - with a long click - remove the click panel:
but If I changed to Msgbox2Async:
I get this error:
How I can fix it?
Thanks in advance for any tip.
B4X:
Sub pnl_LongClick
Dim result As Int
result = Msgbox2("Confirm?", "Remove panel", "Yes", "", "No", Null)
If result <> DialogResponse.Positive Then Return
Dim pn As Panel = Sender
pn.RemoveView
End Sub
but If I changed to Msgbox2Async:
B4X:
Sub pnl_LongClick
Msgbox2Async("Confirm?", "Remove panel", "Yes", "", "No", Null, False)
Wait For Msgbox_Result (Result As Int)
If Result <> DialogResponse.POSITIVE Then Return
Dim pn As Panel = Sender
pn.RemoveView
End Sub
I get this error:
B4X:
chat$ResumableSub_pnl_LongClickresume (java line: 330)
java.lang.ClassCastException: android.app.AlertDialog cannot be cast to android.view.ViewGroup
at b4a.example.chat$ResumableSub_pnl_LongClick.resume(chat.java:330)
Thanks in advance for any tip.