views:

263

answers:

1

Hi

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 solution?

thx

+1  A: 

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

mattsidesinger