What arguments are passed into AsyncTask?

后端 未结 5 1820
陌清茗
陌清茗 2020-11-22 16:49

I don\'t understand what I am supposed to put in here and where these arguments end up? What exactly should I put, and where exactly will it go? Do I need to include all 3 o

5条回答
  •  醉梦人生
    2020-11-22 17:25

    Refer to following links:

    1. http://developer.android.com/reference/android/os/AsyncTask.html
    2. http://labs.makemachine.net/2010/05/android-asynctask-example/

    You cannot pass more than three arguments, if you want to pass only 1 argument then use void for the other two arguments.

    1. private class DownloadFilesTask extends AsyncTask 
    
    
    2. protected class InitTask extends AsyncTask
    

    An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called onPreExecute, doInBackground, onProgressUpdate and onPostExecute.

    KPBird

提交回复
热议问题