Re: [android-developers] AsyncTask question

2011-08-17 Thread TreKing
On Wed, Aug 17, 2011 at 5:00 AM, pedramz wrote: > What should I do here? Use IntentService instead. - TreKing - Chicago transit tracking app for

[android-developers] AsyncTask question

2011-08-17 Thread pedramz
I am using AsyncTask from a Service to Post a message to a server. This is working fine except that we the task is done, my AsyncTask thread is still in Running state. What should I do here? Thanks! -- You received this message because you are subscribed to the Google Groups "Android Developers"

Re: [android-developers] AsyncTask Question

2011-02-14 Thread Danielle Murkerson
Thanks for the help. On Mon, Feb 14, 2011 at 2:46 PM, Kostya Vasilyev wrote: > No, you tell it to cancel when your activity is *paused* (probably > combined with a check for isFinishing()). > > And actually, you don't need to use an AsyncTask for a media player: > > > http://developer.android.c

Re: [android-developers] AsyncTask Question

2011-02-14 Thread Kostya Vasilyev
No, you tell it to cancel when your activity is *paused* (probably combined with a check for isFinishing()). And actually, you don't need to use an AsyncTask for a media player: http://developer.android.com/reference/android/media/MediaPlayer.html#prepareAsync() public void prepareAsync () Si

Re: [android-developers] AsyncTask Question

2011-02-14 Thread Danielle Murkerson
Ok that's good to know...I didn't see anything about that in the docs...So I could just tell it to cancel when the activity resumes. Thanks, DanielleM On Mon, Feb 14, 2011 at 2:32 PM, Kostya Vasilyev wrote: > AsyncTask doesn't know anything about activities or their lifecycles. > > If you leave

Re: [android-developers] AsyncTask Question

2011-02-14 Thread Kostya Vasilyev
AsyncTask doesn't know anything about activities or their lifecycles. If you leave your activity with the back key, it's actually destroyed. So when you come back (by launching again, or by using the recent apps list [long-pressing the home key]), it will be created all over again. It's up to

[android-developers] AsyncTask Question

2011-02-14 Thread DanielleM
Hello all: I'm trying to use an AsyncTask to prepare two MediaPlayer objects while the rest of my activity loads. However, I've noticed that once everything is loaded...I'm able to play my media player just fine, but if I switch to another activity in my app and then switch back to the media playe