M mw71 Well-Known Member Licensed User Longtime User Jan 7, 2020 #1 Hi in a Service i check if the Starter_Service run (if yes, use the Log Sub in Startet Service, if not, write to a File) I use this Code: B4X: Expand Collapse Copy If IsPaused(Starter) Then 'Write to File Else Starter.Cl.Lg....'Use Startet to Log End if Unfortunately Firebase Crashlytics reports an error: Fatal Exception: java.lang.NullPointerException Attempt to read from field 'xx.xxx.xxx.starter xx.xxx.xxx.start_backup._starter' on a null object reference Whats wrong / what can i do?
Hi in a Service i check if the Starter_Service run (if yes, use the Log Sub in Startet Service, if not, write to a File) I use this Code: B4X: Expand Collapse Copy If IsPaused(Starter) Then 'Write to File Else Starter.Cl.Lg....'Use Startet to Log End if Unfortunately Firebase Crashlytics reports an error: Fatal Exception: java.lang.NullPointerException Attempt to read from field 'xx.xxx.xxx.starter xx.xxx.xxx.start_backup._starter' on a null object reference Whats wrong / what can i do?
Computersmith64 Well-Known Member Licensed User Longtime User Jan 7, 2020 #2 How about you post the relevant code in Starter. Actually, post the entire Starter service code. It looks like somewhere in there you're trying to reference an uninitialized object. - Colin. Upvote 0
How about you post the relevant code in Starter. Actually, post the entire Starter service code. It looks like somewhere in there you're trying to reference an uninitialized object. - Colin.
M mw71 Well-Known Member Licensed User Longtime User Jan 8, 2020 #3 Hi, the error happens with the IsPaused line (means the Error Log). That's what i don't understand. I am not sure that the Starter Service is called and the Code is relevant. Upvote 0
Hi, the error happens with the IsPaused line (means the Error Log). That's what i don't understand. I am not sure that the Starter Service is called and the Code is relevant.
Computersmith64 Well-Known Member Licensed User Longtime User Jan 8, 2020 #4 What version of B4A are you using? - Colin. Upvote 0
Computersmith64 Well-Known Member Licensed User Longtime User Jan 8, 2020 #6 Can you reproduce the error or is it just being reported in Crashlytics? How often is it happening? - Colin. Upvote 0
Can you reproduce the error or is it just being reported in Crashlytics? How often is it happening? - Colin.
Erel B4X founder Staff member Licensed User Longtime User Jan 8, 2020 #7 The Starter service will never be paused. You don't need to check it. (unless you mistakenly stop it yourself) Upvote 0
The Starter service will never be paused. You don't need to check it. (unless you mistakenly stop it yourself)
M mw71 Well-Known Member Licensed User Longtime User Jan 8, 2020 #8 Hi, i use B4A 9.5 @Erel The user start the App (and StarterService start....), use the app and make Settings (e.g. Backup at.....). Then the User Close the App, e.g. via Code: ExitApplication Activity.Finish -> the StarterService will be close?? At the setting Time (via StartServiceAt) the BackupService is starting and check if Starter is running or not. (because the backup service can also be called from the activity if the user wants an immediate backup) Upvote 0
Hi, i use B4A 9.5 @Erel The user start the App (and StarterService start....), use the app and make Settings (e.g. Backup at.....). Then the User Close the App, e.g. via Code: ExitApplication Activity.Finish -> the StarterService will be close?? At the setting Time (via StartServiceAt) the BackupService is starting and check if Starter is running or not. (because the backup service can also be called from the activity if the user wants an immediate backup)
Erel B4X founder Staff member Licensed User Longtime User Jan 9, 2020 #9 Never call ExitApplication. It will kill the process. If you are not explicitly stopping the starter service, which is a mistake, then it will never be paused. It will stop when the process ends. Upvote 0
Never call ExitApplication. It will kill the process. If you are not explicitly stopping the starter service, which is a mistake, then it will never be paused. It will stop when the process ends.