Created
December 17, 2021 05:58
-
-
Save championswimmer/0870892bc9f2804e65600e0f5136a92d to your computer and use it in GitHub Desktop.
AsyncTaskExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyTask extends AsyncTask { | |
void onPreTask() { | |
// step 1: this runs on main thread | |
} | |
void onTastExecute() { | |
// step 2: this runs on a separate background thread | |
} | |
void onPostTask() { | |
// step 3: after all things in step2 are done, this runs, | |
// but again on main thread | |
} | |
} | |
// =========== | |
MyTask t = new MyTask(); | |
t.execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment