Android Question java.lang.NullPointerException error when calling function

nima66

Member
Is it possible that in Android 12 and above, when we leave the app for 5 minutes and return to the app, the module code cannot be recognized?
This happened for a variable from the list on some phones and I fixed it.
I store user errors in the server database.
Now the problem is that sometimes when some users temporarily leave the app to pay and return to the app after paying, one of the functions in the module code is called and gives an error.
While according to the test, no error occurs even if the input to this function is empty.
Now I suspect that maybe it doesn't recognize the module code at all.

B4X:
Private Sub poolakey_consumeSucceed
    If purchaseInfo_productId.Trim.Length>0 Then
        Product_ProductId=purchaseInfo_productId

        Private lst As List
        lst.Initialize
        lst.Add(func.set_string(Product_ProductId)) << The error occurs at this line.
        .
        .
        .
        .
 

nima66

Member
Switch to B4XPages.
I have 15 activities with a total of about 10,000 lines of code.
I shouldn't put all the code in one class.
So if I reuse the module code, what's the difference from the current situation?
It is possible that after 5 minutes of the application being in the background, the module code will not be recognized again
Am I right?

What is the overall reason for this problem that some users are experiencing?
 
Upvote 0
Top