what is the difference of thread.sleep and systemclock.sleep. and which one should be used in AsyncTask?
<p>I figured out if I exit an activity while is running the AsyncTask in the middle, and when I try to start that activity again, I will have to wait until the previous AsyncTask to finish before the new AsynTask starts. I tried both thread.sleep and systemclock.sleep and it gives me the same result. Which make sense because I guess the thread that I closed and opened are the same. Its there a way to just cancel the AsyncTask if the user exit an activity? Because then the second time the user enter the same activity he wouldn't have to wait until previous finishes.
I tried asyntask.cancel(true) in onPause(), it doesn't work, same thing happened.</p>
