Android Question B4XPages_closerequest not working

Phayao

Active Member
Licensed User
Longtime User
Hello all,

I get a peristent error as soon as I invoke the B4XPage_closeRequest.
In the ThreePages example:
1) I want to go back from Page 2 to the mainpage by pressing the back arrow on page 2, so i changed:
B4X:
Sub btnLogin_Click
    ' B4XPages.ShowPageAndRemovePreviousPages("Page 2")
    B4XPages.ShowPage("Page 2")
End Sub

2) I include the closerequest event on page 2:
B4X:
Sub b4xpage_closerequest
    Log("close page 2")
End Sub

getting the error on pressing the back arrow:
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
close page 2
b4xpagesmanager$ResumableSub_HandleCloseRequestresume (java line: 619)
java.lang.ClassCastException: java.lang.String cannot be cast to anywheresoftware.b4a.BA$ResumableSub
    at b4a.example.b4xpagesmanager$ResumableSub_HandleCloseRequest.resume(b4xpagesmanager.java:619)
    at b4a.example.b4xpagesmanager._handlecloserequest(b4xpagesmanager.java:592)
    at b4a.example.b4xpagesmanager._activity_actionbarhomeclick(b4xpagesmanager.java:111)
    at b4a.example.b4xpagesdelegator._activity_actionbarhomeclick(b4xpagesdelegator.java:36)
    at b4a.example.main._activity_actionbarhomeclick(main.java:352)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at b4a.example.main.onOptionsItemSelected(main.java:162)
    at android.app.Activity.onMenuItemSelected(Activity.java:3390)
    at com.android.internal.widget.ToolbarWidgetWrapper$1.onClick(ToolbarWidgetWrapper.java:212)

Someone got an idea what I'm doing wrong ?

Thanks very much,

Chris
 
Top