Android: Keep GPS active
i'm having a main activity that runs a gps listener. If i'm starting a new activity the listener is destroyed. I need the gps to be still activated, also after starting the 2nd activity. Do i have to implement an own listener there, or is there another开发者_StackOverflow solution?
I recommend creating a Service that extends LocationListener. I would start your Service from your Activity using startService.
Here is an example: http://androidgps.blogspot.com/2008/09/simple-android-tracklogging-service.html
精彩评论