Searched around but unable to find a solution.
I would like to have a 'back' button on B4J so that form navigation is easier.
I have tried:
and
on the first form then
and
on the second form.
However clicking the back button on the second form results in:
What is the preferred way to implement a back button in B4J?
I would like to have a 'back' button on B4J so that form navigation is easier.
I have tried:
B4X:
Public Sub LoadSpacesForm(callback_module As Object,callback_function As String)
cMod = callback_module
cFun = callback_function
If frm.IsInitialized = False Then
frm.Initialize("frm", 550, 600)
frm.RootPane.LoadLayout("SpacesForm")
End If
frm.Show
FillList2
End Sub
B4X:
Sub btnFavourites_Action
CLVSpaces.Clear
frm.Close
FavouritesForm.LoadFavouritesForm(Me,"LoadSpacesForm")
End Sub
B4X:
Public Sub LoadFavouritesForm(callback_module As Object,callback_function As String)
cMod = callback_module
cFun = callback_function
If frm.IsInitialized = False Then
frm.Initialize("frm", 550, 600)
frm.RootPane.LoadLayout("FavouritesForm")
End If
frm.Show
FillList2
End Sub
B4X:
Sub btnBack_Action
CLVFavourites.Clear
frm.Close
CallSub(cMod,cFun)
End Sub
However clicking the back button on the second form results in:
B4X:
An error occurred:
(Line: 0) End Sub
java.lang.Exception: Sub loadspacesform signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject b4j.example.spacesform_subs_0._loadspacesform(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
No parameters
What is the preferred way to implement a back button in B4J?