Android Question My application looses objects

advansis

Active Member
Licensed User
Longtime User
Hi guys,
I've created an application used by technicyans to insert data of their activities done during the day.
The app must run all over the day, uses a sqllite database, keeps track of gps position, sends data to a webserver and interact with the technicyans through UI forms (activities).
Everything works great, but very often I got a list of errors (java.lang.NullPointerException) after the app has gone to sleep (usually after 10/20 minutes).
The app uses 2 services, one to communicate to the server and the other to get the gps position (both declared as START_STICKY).
The activity (form) that is opened when the device goes sleeping can be each one: there are more than 10 activities and each interface can be called (shown) from several others (following some rules).
I think Android is killing my objects during application sleep :)
Any way to force Android not to kill my objects, or some easy way to save my context and then replace it ?
Any other clue ?
Thanks in advance.

PS. Declaring my variables in modules and classes preserves them from being destroyed ?
 

DonManfred

Expert
Licensed User
Longtime User
Look at statemanager
 
Upvote 0
Top