Pages

Thursday 23 April 2015

Tell something about AsynchTask?

AsynchTask

1)It enable proper and easy use of UI thread.
2)It does the work in background and give the result on UI thread without use of Handler.
3)It has 4 stages
        i)onPreExecute()
                              Invoked before the task executed.
                              Runs in mainThread,

        ii)doInBackground()
                          Invoked in background to perform the task.
                          Runs in backgroundThread,

        iii)onProgressUpdate()
                          Invoked to update the progress UI after the call of onPublishProgress() in                                             doInBackground().

                          Runs in mainThread,
           
        iv)onPostExecute()
                        Invoked to update the UI finally
                        Runs in mainThread,

No comments:

Post a Comment