Android Question isPaused(Activity), but Activity is null

peacemaker

Expert
Licensed User
Longtime User
In my old and complex project i have such errors, when isPaused used with null Activity.
It known by Play Store and Analypics logs, but the error location is unknown.
How can it be ? How to fix ?
 
Error occurs in any Android: 4.4 and 6.0 for sure

Code: Copy
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean anywheresoftware.b4a.BA.isActivityPaused()' on a null object reference
    at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:104)
    at android.os.Handler.handleCallback(Handler.java)
    at android.os.Handler.dispatchMessage(Handler.java)
    at android.os.Looper.loop(Looper.java)
    at android.app.ActivityThread.main(ActivityThread.java)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

But i cannot state where this error occures - isPaused used in any Timer event, checking Activity and services.
Is b4a.BA.isActivityPaused() method only for the activity ? Or for service also ?
 
Upvote 0
@Erel asked you to post the relevant code!
I did not see any code inside your post.
 
Upvote 0
Please, re-read my post under the error text - i do not know where the relevant code is exactly - many timers and many isPaused checkings ....
Java error text is from Play Market developer console - no idea how to understand B4A code part (cross reference file with Java and B4A code lines numbers is needed).
 
Last edited:
Upvote 0
OK, they all are declared correctly, but disabled only in the Main activity (most probable trouble timer), others are not disabled. Is it realy trouble ?
 
Upvote 0
Back
Top