I'm getting a ServiceConnectionLeaked message that I don't understand.

There are 3 activities and a remote service, all the activities use
the same
remote service.  The main window, activity 1, starts up, auto-starts
the
service and binds to it.  The user then starts activity 2 to do
something.
The user now wants activity 3, so the code in activity 2 puts some
data in
an intent and starts activity 1 via startActivity ().  When activity 1
is started,
it reads the data in the intent and starts activity 3.

This all works as expected except that while activity 3 is starting I
get the
ServiceConnectionLeaked warning.  This is odd because the code that
unbinds from the service has never been called and the service
connection
continues to operate just fine.  If the user backs out of the main
window
the service is unbound and everything shuts down correctly.

Because the UI design doesn't want activity 2 to stack on top of 3, or
3 on top of 2 I use a FLAG_ACTIVITY_CLEAR_TOP flag when starting
activity 1.  (I tested with this flag removed and the leak warning
goes away but
I wind up with extra activities/windows in the stack).

To make it even a bit weirder, if I run through the same scenario
again,
e.g. close activity 3 to get back to activity 1, open 2, switch to 3
there is no
leakage the second and successive times, only the first time (near as
I
can tell).

any hints, thoughts?

tia,
  mike

I could pare it all down to an example if that is required/helpful.


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