> But how do i post a message to the service from my activity.

Option #1: If it is a local service, make the service be a singleton
(i.e., in onCreate(), make "this" be available from a public static data
member or method), and have the activity call methods on the singleton.

Option #2: If this is a remote service, extend your AIDL to provide APIs
for the activity to call.

Option #3: Have your activity use sendBroadcast() and implement a
BroadcastReceiver in your service.

There are probably other patterns out there as well.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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