On Wed, Jul 20, 2011 at 4:38 PM, darrinps <[email protected]> wrote:

> Yes I did. That's what I followed. Simply putting a public variable in the
> service to look at BUT how do I efficiently poll to inspect this?
>

Don't - you rarely should be polling for anything.


> I was hoping for a callback to register with the Service.
>

No one is stopping you from adding one to your service.


>  >
> > > The problem is how to block waiting on that without sucking up CPU.
> >
> > Progress dialog?
>
> The Service itself already throws one up.
>

Wait ... what? A Service is not associated with a GUI - how is this even
working?


>  I understand the reference, but I don't see any where in the
> example where any custom callback is done, and I don't see anything clear
> in the API on how to do that.
>

The "custom" part was my indication that this is something you do. "How" is
exactly the same way any other callback in Java works.

Something like mService.setOnCompleteListener(new ServiceCompleteListener()
{ public void onComplete(...); })


HOWEVER - I'm really thinking now that you should probably be doing this
work in the activity itself using an AsyncTask, if the activity is so
dependent on the Service's execution.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

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

Reply via email to