Android Question When to use response.release?

wimpie3

Well-Known Member
Licensed User
Longtime User
I currently have this in my code:

B4X:
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
    Log("http response returned")
    Response.Release
End Sub

However, I get a crash on Response.Release (android.os.NetworkOnMainThreadException).

Is the .release needed, why and in what circumstances?
 

DonManfred

Expert
Licensed User
Longtime User
You should release the job in end of Jobdone-Event. Not in hc_response.
Consider to use httputils2 instead of httpclient
 
Upvote 0
Top