Waiting till the async task finish its work

前端 未结 5 456
说谎
说谎 2020-11-28 21:39

I\'m very new to programming and I have some doubts.

I have a AsyncTask which is I call as RunInBackGround.

and I start this proc

5条回答
  •  时光说笑
    2020-11-28 22:14

    AsyncTask have four methods..

    onPreExecute  -- for doing something before calling background task in Async
    
    doInBackground  -- operation/Task to do in Background
    
    onProgressUpdate  -- it is for progress Update
    
    onPostExecute  -- this method calls after asyncTask return from doInBackground.
    

    you can call your work on onPostExecute() it calls after returning from doInBackground()

    onPostExecute is what you need to Implement.

提交回复
热议问题