Hi all,
In B4J, I use the fx.MsgBox and fx.MsgBox2 to display a message.
B4X:
Dim res As Int = fx.Msgbox2(frm, "Delete this record?", "Confirm", "Yes", "", "No", fx.MSGBOX_CONFIRMATION)
If res = fx.DialogResponse.POSITIVE Then
'delete the record
DBManager.Delete_URLRecord(SelectedID)
fx.Msgbox(frm,"Record deleted.", "Attention")
End If
The position of the opened dialog seems to be random. I'd like it to display center to the owner: frm.
Never mind. I've implemented the xui.MsgBox2Async and xui.MsgBoxAsync methods and they appear to center to the screen instead of random positioning as stated in post #1.
B4X:
Dim sf As Object = xui.Msgbox2Async("Delete selected record?", "Confirm", "Yes", "", "No", Null)
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Positive Then
'delete the record
DBManager.Delete_URLRecord(SelectedID)
InitTVData 'reload tableview
xui.MsgboxAsync("Record deleted.", "Attention")
End If