Hi, Guys
I am using B4Xpages and have a problem with back button operation. I am not using the backbutton built into B4Xpages, its operation (going to the previous page) does not suit my app. However, the user can still press the backbutton on the phone (below the display) and it causes my App to crash with the follow exception
--- First few lines of exception report (hopefully enough)
java.lang.ClassCastException: java.lang.String cannot be cast to anywheresoftware.b4a.BA$ResumableSub
at b4a.Ui_Tests.b4xpagesmanager$ResumableSub_HandleCloseRequest.resume(b4xpagesmanager.java:854)
at b4a.Ui_Tests.b4xpagesmanager._handlecloserequest(b4xpagesmanager.java:821)
at b4a.Ui_Tests.b4xpagesmanager._activity_keypress(b4xpagesmanager.java:576)
at b4a.Ui_Tests.b4xpagesdelegator._activity_keypress(b4xpagesdelegator.java:68)
at b4a.Ui_Tests.main._activity_keypress(main.java:437)
'.......
In the old days (Activity based) I used the
I have tried using the following code, as advised in post https://www.b4x.com/android/forum/threads/b4xpages-handling-the-back-key.119297/ which appeared to discuss a similar problem
B4XPages_CloseRequest but that don't help.
I could handle it with the Main "Delegates" code, but again in the above post, Erel does not recommend touching template code.
Any suggestions
Dave Morris
I am using B4Xpages and have a problem with back button operation. I am not using the backbutton built into B4Xpages, its operation (going to the previous page) does not suit my app. However, the user can still press the backbutton on the phone (below the display) and it causes my App to crash with the follow exception
--- First few lines of exception report (hopefully enough)
java.lang.ClassCastException: java.lang.String cannot be cast to anywheresoftware.b4a.BA$ResumableSub
at b4a.Ui_Tests.b4xpagesmanager$ResumableSub_HandleCloseRequest.resume(b4xpagesmanager.java:854)
at b4a.Ui_Tests.b4xpagesmanager._handlecloserequest(b4xpagesmanager.java:821)
at b4a.Ui_Tests.b4xpagesmanager._activity_keypress(b4xpagesmanager.java:576)
at b4a.Ui_Tests.b4xpagesdelegator._activity_keypress(b4xpagesdelegator.java:68)
at b4a.Ui_Tests.main._activity_keypress(main.java:437)
'.......
In the old days (Activity based) I used the
Classic back button detectio:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
I have tried using the following code, as advised in post https://www.b4x.com/android/forum/threads/b4xpages-handling-the-back-key.119297/ which appeared to discuss a similar problem
B4XPages_CloseRequest but that don't help.
I could handle it with the Main "Delegates" code, but again in the above post, Erel does not recommend touching template code.
Any suggestions
Dave Morris