How to elimimate over riding when using timer thread?
<p>I am implementing an application using a timer.</p>

<p>In the timer, I call a method to get an image from a server.</p>

<p>Inside the timer, I also print the value of variable <code>i</code>, and increment it.</p>

<p>After that I try to print <code>i</code>'s value using logcat.</p>

<p>But sometimes it prints like this:</p>

<pre><code>1 2 3 4 5 5 6 7 7 7 7 7 8 9 10 11 12 12 12 14
</code></pre>

<p>Why is this happening?</p>
