For that kind of thing there should be no need to use bindService at all --
just call startService() for each of the things to download, and have the
service use stopSelf(id) so that it is stopped once the last one is done.
 And there is no reason to delay stopping the service -- starting a service
is quite cheap.

On Sat, Oct 24, 2009 at 2:08 PM, Christine <christine.kar...@gmail.com>wrote:

>
> On Oct 24, 6:47 pm, Mark Murphy <mmur...@commonsware.com> wrote:
>
> > Why aren't you scheduling this in the Activity, and just calling to the
> > Service when the time has elapsed? If the answer is "I want it to fire
> > even if the Activity is gone", AlarmManager may be a better choice.
>
> Actually, the activity hands some data to the service to process,
> triggered by a user action. Typically, a user would do this several
> times in a row, so I figured it would be nice if the service wouldn't
> stop immediately, but just wait for a couple of minutes. I don't want
> the service to keep running indefinitely. The main reason I use a
> service is that uploading the user data can take a while and I want it
> to continue even if the app gets destroyed. The activity stops after
> handing data to the service, and it may get started again for a new
> action involving the service.
>
> > When "after unbind it can't bind again", what are you actually seeing?
> > Exceptions? other log messages? false returned by bindService()?
> > something else?
>
> Actually if there were log messages or anything, I would know where to
> look for the problem. The activity doesn't throw an exception, but the
> "bindService()" doesn't cause onBind() in the service to get called.
> But I'll keep looking, I know I'll find it :-)
>
> dagdag
> Christine
>
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > Android App Developer Training:http://commonsware.com/training
> >
>


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