Hi, everyone, i'm coding an app, and i wanted to do it graphically catchy, so i designed my own msgBox in the designer, and i display it using the custom B4XDialog and loading the layout i did.
Now, the problem is that it doesn't aumatic handle the KeyPress Back event, so you have to do it manually.
THe idea is this:
If there is a dialog shown, and i click “back” it closes (cancel), but If there aren't dialog shown, and i hit “back” then i want to show a dialog saying “if you click Ok, you will leave the app”.
The two cases conflict and the second dialog never will disayed (it open and closes instanly)
Ps.
I also put an "OK" button in the designer because i didn't know how to customdesign in that way the original buttons of the B4XDialog (But this is a secondary problem) (If know how to achieve that appearance keeping the native button also let me know)
I attached the example, try to:
- Click the "Show Dialog" button in main
- Do "back" and it closes (if you want try the "ok" button as well"
- Now, when there are no dialog shown, do "back" again (like you want to leave the app)
- it should display another dialog, but it closes istantly
Now, the problem is that it doesn't aumatic handle the KeyPress Back event, so you have to do it manually.
THe idea is this:
If there is a dialog shown, and i click “back” it closes (cancel), but If there aren't dialog shown, and i hit “back” then i want to show a dialog saying “if you click Ok, you will leave the app”.
The two cases conflict and the second dialog never will disayed (it open and closes instanly)
Ps.
I also put an "OK" button in the designer because i didn't know how to customdesign in that way the original buttons of the B4XDialog (But this is a secondary problem) (If know how to achieve that appearance keeping the native button also let me know)
I attached the example, try to:
- Click the "Show Dialog" button in main
- Do "back" and it closes (if you want try the "ok" button as well"
- Now, when there are no dialog shown, do "back" again (like you want to leave the app)
- it should display another dialog, but it closes istantly