You can do a query on the package manager for all services matching an intent, then iterate over them to find the best. Decide on the best through the app version code or some meta-data associated with the service or something else if you want. Then when you bind to the service, set an explicit component in the intent for the service you have picked.
On Thu, Dec 17, 2009 at 9:20 AM, Watcher <[email protected]> wrote: > Hi, > > I have the same service in multiple APKs. In each of the APKs, I am > going to launch the serivce. > Because the APK are difference "applications" that have been installed > & upgraded at various times, the service implementation in each may be > different. I am trying to figure out a way to make sure startService() > runs the implementation that is newest. > > I have been fiddling around with PackageManager and Manifest meta-data > and categories but I can't seem to get my head around it. It's really > a leader-election problem... has anyone ever done this ? Any clues ? > > Thanks ! > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

