This isn't so much a problem with HTTP Utils as it is a problem that happens with CallSub2, which HTTP Utils uses.
In the service, there are several statements similar to this:
This has worked well for me for a long time now. But since upgrading to B4A 2.0, I noticed that I was suddenly getting Null Pointer Errors in one of my activities that used HTTP Utils if the activity was backed out of before HTTP Utils was finished.
I fixed this by changing the code above to the following for all CallSub2 statements in my various HTTP Utils-based services:
I'm not sure why this suddenly got broken but if anyone else sees this problem, hopefully the solution above will fix it for you as well.
In the service, there are several statements similar to this:
B4X:
If HttpUtils.CallbackJobDoneSub <> "" Then
CallSub2(HttpUtils.CallbackActivity, HttpUtils.CallbackJobDoneSub, HttpUtils.Job)
End If
This has worked well for me for a long time now. But since upgrading to B4A 2.0, I noticed that I was suddenly getting Null Pointer Errors in one of my activities that used HTTP Utils if the activity was backed out of before HTTP Utils was finished.
I fixed this by changing the code above to the following for all CallSub2 statements in my various HTTP Utils-based services:
B4X:
If HttpUtils.CallbackJobDoneSub <> "" AND IsPaused (HttpUtils.CallbackActivity) = False Then
CallSub2(HttpUtils.CallbackActivity, HttpUtils.CallbackJobDoneSub, HttpUtils.Job)
End If
I'm not sure why this suddenly got broken but if anyone else sees this problem, hopefully the solution above will fix it for you as well.