This code is completely wrong:
Sub btnOkDialog_Click As ResumableSub
Wait For (dialog.Close(xui.DialogResponse_Positive)) Complete (Result As Boolean)
Return True
End Sub
See my previous answer.
Sorry i forget to delete that from the test project, in the real code i changed that Line in:
Sub btnOkDialog_Click
dialog.Close(xui.DialogResponse_Positive)
End Sub
(Anyway i think that it's not the problem, because i don't use the "ok" when button the problem happends, it happend exclusively with the keyback (that on my phon is a differnte value :/)
View attachment 80813
Here you are another Gif explaining what happens, i enabled the ASSISTIVE TOUCH (the round white dot in the right corner) and you can see my finger tap.
Tapping on the Assistvie touch triggers the Key BACK (real one, with the keycode 4), so the b4xDialog shows up, but then if i tap another time on the Assistive touch to close the dialog it doesn't want to close (p.s. at the end I tap on the "No" button, and it closes, so i don't think is that the problem)
IMPORTANT
Sorry for the long posts but it's hard to explain well...
I
"""SOLVED"""" the problem, changing the if condition in:
If ((KeyCode = KeyCodes.KEYCODE_BACK)) And dialog.Close(xui.DialogResponse_Cancel) Then
It works like a charm, if the keycode sended by the phisical button of the phone is 4, but in my case, I VERY DON'T KNOW WHY, the code is 269!
Well, at this point you can say "put an OR in the if condition to check also the code 269", yes it was the first first first thing i did, but this bring us to the initial problem...
from my experience i noticed that even if the condition is:
If (KeyCode = 269) And dialog.Close(xui.DialogResponse_Cancel)
and i go back with the assistive touch, (so keycode = 4, NOT 269) the if goes True anyway!!! D: but evidently in a different way, im getting crazy