What is AsyncTask?

Answered
474 views.

I need unimplemented methods in AsyncTassk

Add Comment
2 Answer(s)
Best answer
441 views.

AsynTask is a abstract class  , which perform  background operation for our need, and show the result on the UI, Which having the 3 abstract methods those are doInbackground(), onPreExecute(), onPostExecute().

Add Comment
418 views.

AsyncTask is an abstract class provided by Android which helps us to use the UI thread properly. This class allows us to perform long/background operations and show its result on the UI thread without having to manipulate threads.

AsyncTask has four steps:

doInBackground:

Code performing long running operation goes in this method. When onClick method is executed on click of button, it calls execute method which accepts parameters and automatically calls doInBackground method with the parameters passed.

onPostExecute:

This method is called after doInBackground method completes processing. Result from doInBackground is passed to this method.

onPreExecute:

This method is called before doInBackground method is called.

onProgressUpdate:

This method is invoked by calling publishProgress anytime from doInBackground call this method.

Go through this link for example 

http://www.compiletimeerror.com/2013/01/why-and-how-to-use-asynctask.html#.V2o0D9l97Dc

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.