How do I create an object in TimerTask in Android?
<p>I'm trying to make the canvas draw some pictures in a fixed period of time. It's like an item showing on the screen and it disappears after 5 seconds. Then after another 3 seconds, a new item is drawn and last for another 5 seconds.
I used Timer and TimerTask as below</p>

<pre><code>    public class PowerUpMaking extends TimerTask{
        public void run() {
              test = 1;
              powerUp = new Powerup(players.get("player1"),getHeight());                
        }
    }
</code></pre>

<p>I declared powerUp in the constructor. Whole thing is in a class that extends View.
What I want to do is just to create a new object for the reference variable.
It turns out the first line is working but the second line is not by checking the log.
How am I supposed to deal with this situation?
Many many thanks if anyone can help. First time to ask a question here actually.</p>
