Use Intent.putExtra(): http://developer.android.com/intl/fr/reference/android/content/Intent.html#putExtra(java.lang.String, android.os.Bundle)
An example can be found here: http://www.agilemedicine.com/medBlog/?tag=putextra Something like this should work for you: Intent i = new Intent("ww.main.LOCATOR_SERVICE"); i.putExtra(myObject); context.startService(i); Ensure the class for "myObject" implements Serializable. On Wed, Jan 13, 2010 at 11:40 AM, Nick Burton <[email protected]> wrote: > I'm a bit confused about passing object references... if we start a > service using intents, how can we pass refs between the class where > this code sits, and the service? There's no object created by me so I > can't pass parameters... > > -- > Intent i = new Intent("ww.main.LOCATOR_SERVICE"); > context.startService(i); > -- > > Or am I starting the service incorrectly? > > Cheers, > > Nick > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > > NEW! Try asking and tagging your question on Stack Overflow at > http://stackoverflow.com/questions/tagged/android > > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en > >
-- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

