Munish wrote:
> I am trying to pass a string from an activity class to a service
> class.
> but cant do the same as service doesnot take arguments of BUNDLE type
> in onCreate method

Here are three options off the top of my head:

Option #1. If your activity is starting the service via startService(),
you can pass data via the Intent, which is received in the service in
onStart().

Option #2. If your activity is binding to the service via bindService(),
just add another AIDL API function for whatever string it is you want to
pass.

Option #3. If the activity and service are in the same application, you
can use static methods or the like to pass data around.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android Training in Sweden -- http://www.sotrium.com/training.php

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to