Last active
February 16, 2021 17:03
-
-
Save AliAsadi/41365a323c46b0c3ff9887ed197e6d90 to your computer and use it in GitHub Desktop.
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
public class ThreadActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
//.... | |
new DownloadTask(this).start(); | |
} | |
private class DownloadTask extends Thread { | |
private final ThreadActivity threadActivity; | |
public DownloadTask(ThreadActivity threadActivity) { | |
this.threadActivity = threadActivity; | |
} | |
@Override | |
public void run() { | |
SystemClock.sleep(2000 * 10); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment