Yah.  Check 
out http://developer.android.com/reference/android/os/Looper.html

Initialize your background thread as a Looper, and then just create 
AsyncTasks on it.  They will run doInBackground in an executor thread pool 
and then call onPostExecute back on the background thread, the one on which 
you created the AsyncTask subclass instance.

-blake

On Thursday, February 7, 2013 2:36:00 PM UTC-8, dashman wrote:
>
>
> I have a main background thread that's doing work that's needed
> to be done relatively quickly...i.e. update the screen.
>
> But there are times where I might have to do some additional work
> (that's not that much of a priority - i was thinking of making that
> an AsyncTask.
>
>
> The notify/wait was a generic question - whether those can be used
> and/or recommended for use under the android platform.
>
>
>
>
> On Thursday, February 7, 2013 10:27:38 AM UTC-5, G. Blake Meike wrote:
>>
>> You should say something about what you are trying to accomplish. 
>>  Starting an AsyncTask from a background thread is already a bit odd... 
>> waiting for it to complete (which you imply with your comments about .wait 
>> and .notify) is downright nuts.
>>
>> Did you know that onPostExecute will be run on the thread on which the 
>> AsyncTask is created, provided that thread is a Looper?  If you just init 
>> your background thread as a Looper, you might be able to use the AsyncTask 
>> normally...
>>
>> -blake
>>
>> G. Blake Meike
>> Marakana
>>
>> Programming Android 2ed is now in stores:
>> http://bit.ly/programmingandroid
>>
>>
>> On Thursday, February 7, 2013 2:04:38 AM UTC-8, dashman wrote:
>>>
>>> I'm in a worker thread and would like to start an AsynTask execution.
>>>
>>> Preferably w/o starting a new thread. Help!
>>>
>>>
>>> Also, is java threads as in (new Thread()) frowned upon in android.
>>>
>>> I think i read somewhere .notify() .wait() etc. should not be used.
>>>
>>>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to