Hey
I call a Download Service in Activity_Create.
After Download has been completed the Subs will be called by CallSubDelayed
Results in everything correctly loaded but not showing any menu items. Adding the Menuitems in Activity_Create does add them.
CallSub instead of CallSubDelayed does not work. Activity.Invalidate neither
Where is the problem?
I call a Download Service in Activity_Create.
B4X:
Sub Activity_Create(FirstTime As Boolean)
ProgressDialogShow2("Loading", False)
UniversalDownload.url = "http[...]"
UniversalDownload.Target = File.OpenOutput(File.DirInternal, "file", False)
UniversalDownload.CallSubInModuleWhenFinished = Array(Me,Me)
UniversalDownload.CallSubWhenFinished = Array As String("Down_Success", "Down_Failed")
StartService(Downloader)
End Sub
After Download has been completed the Subs will be called by CallSubDelayed
B4X:
Sub Down_Success
Dim Text As String
Try
Text = File.ReadString(File.DirInternal, "file")
Catch
End Try
If Not(Text = "") Then
Activity.AddMenuItem3("A1", "a1", LoadBitmap(File.DirAssets, "image.jpg"), True)
End If
Activity.LoadLayout("s")
Activity.AddMenuItem3("In", "in", LoadBitmap(File.DirAssets, "in.png"),True)
FollowingSub
End Sub
Results in everything correctly loaded but not showing any menu items. Adding the Menuitems in Activity_Create does add them.
CallSub instead of CallSubDelayed does not work. Activity.Invalidate neither
Where is the problem?