Hi all
Could somebody please tell me what the equivalent B4i command is for the B4A command:
ProgressDialogShow("Please wait...")
Thanks
I have implemented the ProgressDialog, however, it does not appear. In B4A, we use the DoEvents command to force the UI to display the progress icon. Is there an equivalent in B4i?You must import HUD library and then declare an object of that class
es:
dim hd as HUD
hd.progressDialog
Here's the reference https://www.b4x.com/b4i/help/ihud.html
No, probably you have implemented the ProgressDialog wrong, but it's hard to help you without seeing the code.Is there an equivalent in B4i?
No, probably you have implemented the ProgressDialog wrong, but it's hard to help you without seeing the code.
Jan
hd.ProgressDialogShow("Please wait...")
Page1.RootPanel.RemoveAllViews
Page1.RootPanel.LoadLayout("ActivitiesA")
Not easily as it is part of a large project.Mhh, should work. Can you upload a example project?
Could you give an example please of how I would use asynchronous methods in this situation?I guess, your are hiding the dialog immediately after you have showed it, so there is no time, in which the dialog could be visible for you. Try to work with asynchronous methods to avoid this.
Dim Job As HttpJob
Job.Initialize("",Me)
hd.ProgressDialogShow("Please wait...")
Job.Download("Link")
hd.ProgressDialogHide
I have implemented the ProgressDialog, however, it does not appear. In B4A, we use the DoEvents command to force the UI to display the progress icon. Is there an equivalent in B4i?
Usually i use the ProgressDialog when i'm downloading some data, that is an operation that don't pause the main thread of the application.
I've tried the ProgressDialog combined with database or "loading views" operations without seeing anything.
Asynchronous method calls doesn't block the calling thread while waiting for a reply.
(For example the HTTPJOB).
In simple words:
The HTTP JOB is an object that allow you to make a call to a Web server.
After the Call your HTTP JOB object is waiting for a response from the sever without blocking the execution of your main thread.
It means that you can continue doing operation while the object is waiting for response, for example showing a ProgressDialog.
When the HTTP JOB object get a response from the server, it will raise an event that give you the status of the operation (in this sub you can hide your ProgressDialog)
I hope to have been clear and simple. My english is elementary.
Erel, I have changed my code to use CallSubDelayed, however, I now receive this error: Object was not initialized (B4IPanelView). I assume this is because of the way I have changed it?You can use CallSubDelayed or CallSubPlus to load the layout.
Sub LoadSectionB
hd.ProgressDialogShow("Please wait for the lessons to load...")
CallSubDelayed(Me,"LoadLayoutB")
' Page1.RootPanel.RemoveAllViews
' Page1.RootPanel.LoadLayout("ActivitiesB")
' PositionThePanels
' sectionBLoaded = True
' sectionALoaded = False
hd.ProgressDialogHide
End Sub
Sub LoadLayoutB
Page1.RootPanel.RemoveAllViews
Page1.RootPanel.LoadLayout("ActivitiesB")
PositionThePanels
sectionBLoaded = True
sectionALoaded = False
End Sub