08-05-2008 07:30 AM - edited 08-05-2008 10:21 AM
08-05-2008 10:00 AM
Not seen this problem, we have applications using LocationListener that stop and restart (using SystemListener methods) correctly during device restart on the levels of OS you are talking about.
How do you kick it back into life once this happens?
08-05-2008 10:21 AM
08-05-2008 11:07 AM
Just had a quick look at the code, and can't quickly figure what it is doing, sorry, but I think the theory is as follows:
1) Your application is autostarted
2) On autostart, you add the app as a SystemListener.
3) Then you check to see if you are in the startup phase using ApplicationManager.inStartup(). If you are in startup you can't do any UI processing, so you may delay your startup till SystemListener powerUp() is called, otherwise you can do it straight away (the second case covers installation time).
4) You stop your threads etc. in SystemListener powerOff().
I believe I have had problems assuming the RuntimeStore would be cleared over a 'soft' power down and restart (such happens when you press the mute key), but adding a SystemListener as described above solved that.
What I can tell you, from my review of the code, is that it will find it has NOT had a valid GPS location for some time (because the device has been powered down) and this will cause it to stop and restart the Location Provider - it could be this stop and restart, rather than the handling of the powerOff and powerUp that provokes the recovery.
Hope this helps.