I'm trying to inform the user of progress of my database upgrade.
In my main activity, I load my usual layout before calling DDB.Init, which is in a code module.
If a DDB needs converting, it attempts to call a Sub in Main, which loads up a panel to cover the usual main screen, and writes text to a label, informing the user of update progess.
However, when I call the Main functions to update the label, these functions never seem to get hit.
I have just realised that the problem must be that the DDB conversion will be occurring before I return to main's Activity_Create..
I'm trying to figure out a way round this, so far I can only think to trigger the DDB.Init from a timer, but then I thought maybe CallSubDelayed may offer a way out. Would doing:
be of any help or am I barking up the wrong tree?
In my main activity, I load my usual layout before calling DDB.Init, which is in a code module.
If a DDB needs converting, it attempts to call a Sub in Main, which loads up a panel to cover the usual main screen, and writes text to a label, informing the user of update progess.
However, when I call the Main functions to update the label, these functions never seem to get hit.
I have just realised that the problem must be that the DDB conversion will be occurring before I return to main's Activity_Create..
B4X:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
Global.selectedPatient.Initialize
StartService(Unit_Comms)
End If
Activity.LoadLayout("MenuL")
If FirstTime Then
DDB.InitDdb 'conversion happens here if it is required
End If
End Sub
I'm trying to figure out a way round this, so far I can only think to trigger the DDB.Init from a timer, but then I thought maybe CallSubDelayed may offer a way out. Would doing:
B4X:
If FirstTime Then
CallSubDelayed(DDB, "InitDdb")
End If
be of any help or am I barking up the wrong tree?