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