Android Question sending message to waiting queue of uninitialized activity (submitjob)

EduardoElias

Well-Known Member
Licensed User
Longtime User
Hi There,

Just upgraded from a previous version of B4A (11.20) and I was aware of the problem with OkHTTPUtils2.

I have a library (b4a created with compile to library) that comunicates with the rest server api using OKHTTPUtils2 (I was using the previous version before)

This library have many subs reflecting each possible calling from the server api.

This is everywhere in my big source code.

I create an object with my library, in one specific place:

B4X:
'Class module
Sub Class_Globals
    Private FClientIssuer             As yClientIssuer
end sub

Public Sub Initialize(ApkName As String, ConnectionType As Int, AppType As String)

FClientIssuer.Initialize()

Public Sub Server As yClientIssuer
    Return FClientIssuer
End Sub

then I use it like this: Server.DoLogin

This is everywhere... It is called from other modules either.

Inside my yClientIssuer (where the api is called)

B4X:
    Wait For (QServer) JobDone(job As HttpJob)
    If QServer.Success Then
        JobDone(job)
    End If

I cannot change to B4Xpages... this is a huge project and the concept of pages does not fit for this project (this is a POS system, it is static layout)
 
Solution
FOUND A SOLUTION

The LIbraries that are using okHTTPUtils2 I have changed to B4XLibs

Recompiled everything and worked.

It is much faster now than before to comunicate with the server

DonManfred

Expert
Licensed User
Longtime User

sending message to waiting queue of uninitialized activity​


This means that your activity is in the background and already destroyed. So you started a request and the the activity changes before the request finishes.

Move your connection-things to a service or a class initiated from a service.
Or move to b4xpages and forget about such issues. But as you stated your app is too big already.

You have to live with the activitylifecycle and fight with it then.
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User

sending message to waiting queue of uninitialized activity​


This means that your activity is in the background and already destroyed. So you started a request and the the activity changes before the request finishes.

Move your connection-things to a service or a class initiated from a service.

That is strange, my app remains the active one... it is a POS system, it never gets to the foreground.

This is all working on 11.20 with old OkHttpUtils
 
Upvote 0

EduardoElias

Well-Known Member
Licensed User
Longtime User
FOUND A SOLUTION

The LIbraries that are using okHTTPUtils2 I have changed to B4XLibs

Recompiled everything and worked.

It is much faster now than before to comunicate with the server
 
Upvote 0
Solution
Top