Android Question How to show progressdialog on B4XPage_Created

jroriz

Active Member
Licensed User
Longtime User
The progresdialog is not showing with the code below.
How to solve it?

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    B4XPages.SetTitle(Me, "Safety MOV VR")

    ProgressDialogShow("Aguarde...")
    Svr.Initialize(Me,"Svr")
    Svr.Start(51051)

    Dim Unzip As Archiver
    File.Copy(File.DirAssets,"vr.zip",Svr.TempPath,"vr.zip")
    Unzip.Unzip(Svr.TempPath,"vr.zip",Svr.TempPath,"")
        
    ProgressDialogHide

End Sub
 

teddybear

Well-Known Member
Licensed User
The progresdialog is not showing with the code below.
How to solve it?
Try this code
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    B4XPages.SetTitle(Me, "Safety MOV VR")

    ProgressDialogShow("Aguarde...")
    sleep(200)
    Svr.Initialize(Me,"Svr")
    Svr.Start(51051)

    Dim Unzip As Archiver
    File.Copy(File.DirAssets,"vr.zip",Svr.TempPath,"vr.zip")
    Unzip.Unzip(Svr.TempPath,"vr.zip",Svr.TempPath,"")
        
    ProgressDialogHide

End Sub
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
All your code does is allow the b4xpage_appear event to fire.

See Erel's description of the event lifecycle for b4xpages.


I have highlighted the relevant items.

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…