Android Question IsPaused, Error

mw71

Active Member
Licensed User
Longtime User
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:
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
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

mw71

Active Member
Licensed User
Longtime User
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

Computersmith64

Well-Known Member
Licensed User
Longtime User
Can you reproduce the error or is it just being reported in Crashlytics? How often is it happening?

- Colin.
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
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
Top