Android Source--asyntask

Source: Internet
Author: User

Asynctask<params, Progress, result> three parameters are: Params         input data Progress       process data Result           Results data   Task Linkedlockingqueue features       The thread takes the task execution from the empty Linkedlockingqueue, and the thread is blocked by the;      thread adding the task to a full linkedlockingqueue, which is also blocked.  onprogressupdate and OnPostExecute perform interface-related operations.  internalhandler:case message_post_result:     result.mtask.finish (result.mData[0]);  Case message_post_progress:     result.mtask.onprogressupdate (result.mdata);  case MESSAGE_POST _cancel:     result.mtask.oncancelled ();   The process of creating an asynchronous task:   execution: Call the Execute method during execution, Calls the member function of an internal callable object call to perform a specific task execution in Doinbackground if the asynchronous task needs to perform interface-related operations, call publishprogress, This method will think of Shandler send a message_post_progress message to Onprogressupdate to handle. Futuretask member function done called done first calls the Asyntask.get method to get the result data for the current work task and encapsulates it as a Message_post_result message Asyntask.finish method to process message _poSt_result message.  

Android Source--asyntask

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.