peacemaker Expert Licensed User Longtime User Nov 27, 2016 #1 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 ?
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 ?
Erel B4X founder Staff member Licensed User Longtime User Nov 27, 2016 #2 Can you post the error message? And the relevant code? Upvote 0
peacemaker Expert Licensed User Longtime User Nov 27, 2016 #3 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
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 ?
DonManfred Expert Licensed User Longtime User Nov 27, 2016 #4 @Erel asked you to post the relevant code! I did not see any code inside your post. Upvote 0
peacemaker Expert Licensed User Longtime User Nov 27, 2016 #5 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: Nov 27, 2016 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).
Erel B4X founder Staff member Licensed User Longtime User Nov 27, 2016 #6 Make sure that all your timers are declared as Process_Global variables and are disabled in Activity_Pause. Upvote 0
Make sure that all your timers are declared as Process_Global variables and are disabled in Activity_Pause.
peacemaker Expert Licensed User Longtime User Nov 27, 2016 #7 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
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 ?
Erel B4X founder Staff member Licensed User Longtime User Nov 27, 2016 #8 peacemaker said: Is it realy trouble ? Click to expand... It is hard to say whether this is the cause for these errors, however it is correct to pause them when the activity is paused. Upvote 0
peacemaker said: Is it realy trouble ? Click to expand... It is hard to say whether this is the cause for these errors, however it is correct to pause them when the activity is paused.
DonManfred Expert Licensed User Longtime User Nov 27, 2016 #9 peacemaker said: others are not disabled. Is it realy trouble ? Click to expand... make sure you disable all running timers in activity_pause and (if neccessary) enable them again in activity_resume Upvote 0
peacemaker said: others are not disabled. Is it realy trouble ? Click to expand... make sure you disable all running timers in activity_pause and (if neccessary) enable them again in activity_resume