Here's an idea: In Android, whenever you have a separate logical component shared between multiple activities, factor its interface out into a Service.
In this case, you would have a Service which controlled the LocationManager (as in http://stackoverflow.com/questions/8672736/starting-locationmanager-as-service-android). You can have intents to interface to the Service, or bind to it and do communication that way.. kris On Tue, Jun 5, 2012 at 1:17 PM, Manuel Ángel Garcia Gallego <[email protected]> wrote: > Hello everbody > > I am a newbiew developping applications in Android. Sorry for any English > mistake I could make but I am not a proficiency English speaking person. > > I'm trying to develop a simple application to manage all my sundries. I just > want to save the concept, date and place on every spending a have. > > My application is only two activitys at the moment. First one has two > bottons: "Save another spending" and "Historical view". What I ment to do is > to create a LocationManager at the moment when my application starts running > so it could start getting the location at that time. This way, when second > activity is shown after "Save another spending" botton is pressed, some of > the work of getting location is already done and it would be faster to show > the location returned by the LocationManager object. > > Problem is I have read that LocationManeger objets are not parcelables or > serializables so, how can I pass the object between to Activity? I guess I > can't use an Intent. > > Other option I have thought could be using a service but... > OnLocationChanged() is an asyncronous event, so when it happens, how could I > change a textEdit on second activity. > > Could anyone help me? Thank you very much > I hope my explanation is clear but I'm not use to write about this topics in > English. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

