Why Android Timer is not working properly?
<p>I have two web-serices say w1,w2 ,w1 is for reciving messages sended by any user for sending message we are using w2  web-services. for recieving message I am calling w1 web service which return list of messages sended by w2 web-service.For fetching messages we hit w1- web-services using timer as</p>

<pre><code>private void startservice() 
{
    timer.scheduleAtFixedRate(new TimerTask() 
    {
        public void run() 
        {
            new Thread()
            {
                public void run()
                {
                    Looper.prepare();
                    SharedPreferences myPrefs = getSharedPreferences("myPrefs", MODE_WORLD_READABLE);
                    String prefName = myPrefs.getString(MY_ID, "0");
                    if(!prefName.equalsIgnoreCase("0"))
                    {
                        receiveMessage();
                    }
                }
            }.start();
            Log.e("b4 setmessage","1:"+ChatScreen.kvp.size());

    }

    }, 0, INTERVAL);
}
</code></pre>

<p>we use kvp list and show in list view ,but problem is that suppose any one sen message that is not showing here and seldom show 2-3 messages recieve out of 6.and seldom messages send and not recieve here. I thing there is some scheduling problem please anyone give me right suggestion ..</p>
