My application is essentially a gps tracker. It binds a service to the GPSActivity which creates a thread to calculate distance, speed and things like that.
Before I had the gps thread in the service it was in the GPSActivity and worked fine. I’m switched it to a service so it would be able to persist in the background if the user needed to use another application.
However sometimes at the beginning of the gps tracking peroid the onKeyDown method in GPSActivity is being called with out me actually pressing the button.
Does this mean that onDestroy is trying to be called and that I’m using too much memory?
Any help to explain this behavior is greatly appreciated.
I solved my problem by adjusting my onKeyDown method as follows: