Hello community,
in my app I use different pages. I use the following code on page 2 to update values in the main page.
Page 2:
Main Page:
When I test my app I have sometimes situations where I can see in the log that the values on page 2 are correct recognized on the main page but the SelectedIndex still stays in the old value. I do not know why.
Log:
Which mistake I made?
Is there a way that I can better debug this situation?
Best regards
--Christian
in my app I use different pages. I use the following code on page 2 to update values in the main page.
Page 2:
B4X:
Private Sub B4XPage_Disappear
SaveString = "Active Profile" & ";" & cbProfile.SelectedItem
File.WriteString(DataProfileFolder, "Dicy_Active_Profile.txt", SaveString)
Log("Sub: B4XPage_Disappear; Active Profile written")
ActiveProfileIndex = cbProfile.SelectedIndex
Log($"Sub: B4XPage_Disappear; Active Profile Index: ${ActiveProfileIndex}"$)
B4XPages.MainPage.Update
End Sub
Main Page:
B4X:
Public Sub Update
cBoxProfile.SelectedIndex = ManageProfilePage.ActiveProfileIndex
Log($"Manage profile; Active Profile Index: ${ManageProfilePage.ActiveProfileIndex}"$)
Log($"Main Page; Active Profile Index: ${cBoxProfile.SelectedIndex}"$)
End Sub
When I test my app I have sometimes situations where I can see in the log that the values on page 2 are correct recognized on the main page but the SelectedIndex still stays in the old value. I do not know why.
Log:
Rich (BB code):
Sub: B4XPage_Disappear; Active Profile Index: 13
Manage profile; Active Profile Index: 13
Main Page; Active Profile Index: 6
Which mistake I made?
Is there a way that I can better debug this situation?
Best regards
--Christian