1) Open a page, hide the back button and set a TopLeftButton to some new value
2) Perform some operation (Like display a Tableview) and then click the TopLeftButton to return to the same page I was on (Remove the Tableview)
3) Remove the TopLeftButton and then display the back button again with the original 'back' text that the page opened with
Clearing the top left buttons will return the back key.
Check this example:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private page2 As Page
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
page2.Initialize("page2")
page2.RootPanel.Color = Colors.Red
Dim b1 As BarButton
b1.InitializeText("abc", "abc")
page2.TopLeftButtons = Array(b1)
End Sub
Sub Page1_Click
NavControl.ShowPage(page2)
End Sub
Sub page2_BarButtonClick (Tag As String)
If Tag = "abc" Then
page2.TopLeftButtons = Array() '<----------------------
End If
End Sub