Here's a common implementation that I used.
The Handler and TimerTask that is randomly within my activity class.
I have a Timer global variable in the AsyncTask class, so then I instantiate the timer and run it like this within the Async doInBackground method:
In the post execute method, I cancelled the timer. Not sure if the timer will still be running after the AsyncTask is done, so I cancelled it just in case.
In the doInBackground, I could've handled all the code in one section without creating any classes in the activity. So it would've looked like this:
Hmmm, this seems better to use. I'll switch that in my code later.