Android Question Timing issue in B4XPages?

Bob Spielen

Active Member
Licensed User
Longtime User
I get sometimes the attached error message! I think I have a timing problem, in other words Im trying to read the Page when it is still being loaded...
How can I know for sure when the Page was loaded?
 

Attachments

Tks for the fast reply!
2 prints logs release mode

I have a MyStarter that does some download from the server. Can it be that during the time that MyStarter works I have the pointed issue caused by delaying the Pages.Initialize ?

Code: Copy
    Dim MStarter As MyStarter: MStarter.initialize 
    Wait For (MStarter.Start_sevice) complete(Ok As Boolean)

    PedidoPg.initialize
    B4XPages.AddPageAndCreate("PedidoPg", PedidoPg)
  
    Entrada.initialize
    B4XPages.AddPageAndCreate("Entrada", Entrada)
 
    MenuPg.Initialize
    B4XPages.AddPageAndCreate("MenuPg", MenuPg)

    ProdutosPg.initialize
    B4XPages.AddPageAndCreate("ProdutosPg", ProdutosPg)
  
    If badger1.IsInitialized = False Then badger1.initialize
 

Attachments

Last edited:
Upvote 0
All that I can say, based on the information you provided, is that the error happened when you clicked on lblEntrada and you tried to set the Text property of a different view that wasn't initialized.
Yes on other B4XPage. Does it exist a suggestion to check if this other Page has been already (finished) loaded?
 
Upvote 0
All that I can say, based on the information you provided, is that the error happened when you clicked on lblEntrada and you tried to set the Text property of a different view that wasn't initialized.

Resolved...I changed from this:
B4X: Copy
Entrada.LbLTitulo1.text = "Entrada"
B4XPages.ShowPage("Entrada")

To this:

B4X: Copy
B4XPages.ShowPage("Entrada")
Entrada.LbLTitulo1.text = "Entrada"
 
Upvote 0

Similar Threads

Replies
8
Views
17K
Replies
2
Views
13K
Replies
22
Views
42K
  • Locked
  • Article Article
Replies
4
Views
23K
Back
Top