Bug  in timer task?
<p>I have a timer task to update my UI , it works between 500 milies delay , but if null out timer and timer task and run timer again , both of them will work !!! how can I solve this problem .</p>

<pre><code>if (timer != null) {
                timer.cancel();
                timer.scheduleAtFixedRate(timerTask, 500, 500);

            } else {
                timer = new Timer("Progress Timer", true);
                timerTask = new MyTimerTask();
                timer.scheduleAtFixedRate(timerTask, 500, 500);
            }
</code></pre>
