You don't need to create a new Binder, you can return the same Binder for
multiple different intents.  Actually you could just return the same Binder
and ignore the incoming Intent completely, but that may lead to problems in
the future if you do define new interfaces and apps try to bind to them
against an old service.

On Wed, Jul 1, 2009 at 11:33 AM, Gert <gsch...@gmail.com> wrote:

>
> I have a service working with selectable backends internally, and the
> user is able to select which on to bind to. I was hoping to optimize a
> bit by have that selection made by the bindService call, and just keep
> a single Binder per backend implementation. Guess I'll just create a
> new Binder per bindService, and point it to the backend to use.
>
> Anyway, thanks for the information - following the the documentation
> it is :)
>
> Regards,
>  Gert Scholten
>
> On Jul 1, 6:24 pm, Dianne Hackborn <hack...@android.com> wrote:
> > Yeah that is a little wrong...  the extras are very complicated, because
> the
> > bind is cached in various places.  So you will see the extras for -some-
> > request to bind, but not necessarily the current one.
> >
> > I would strongly strongly strongly urge against using extras here.  There
> > really is no need at all -- you will be getting back a full IPC interface
> to
> > the object, through which you can do whatever interaction and data
> passing
> > you want.  The Intent in this API is intended -only- to identify which
> > interface you are interested in.  (I think I had intended the code to
> strip
> > out the extras because of how undefined it is about what you will get,
> but
> > apparently had forgotten to do that.)
> >
> >
> >
> > On Tue, Jun 30, 2009 at 11:25 AM, Gert <gsch...@gmail.com> wrote:
> >
> > > Hi,
> >
> > > I have a question about the availability of the extras in an intent
> > > passed to Service.onBind(). The documentation at
> >
> > >
> http://developer.android.com/reference/android/app/Service.html#onBin...)<
> http://developer.android.com/reference/android/app/Service.html#onBin...>
> > > specifically states "Note that any extras that were included with the
> > > Intent at that point will not be seen here.". However, extras are
> > > available (emulator, SDK 1.5).
> >
> > > Is the documentation off/outdated and are the extras available
> > > intentionally, or are they unintentionally exposed to the onBind
> > > method? Can we rely on extras remaining available at this point?
> >
> > > Regards,
> > >  Gert
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > 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.
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to