63.5 Subclassing AsyncTask
In order to create a new thread, the code to be executed in that thread needs to be performed within an AsyncTask instance. The first step is to subclass AsyncTask in the MainActivity.kt file as follows:
package com.ebookfrenzy.asyncdemo
.
.
import android.os.AsyncTask
.
.
class MainActivity : AppCompatActivity() {
private inner class MyTask : AsyncTask<String, Void, String>() {
override fun onPreExecute() {
}
override fun doInBackground(vararg params: String): String {
}
override fun onProgressUpdate(vararg values: Int?) {
}
...