How I can use a handler to change the ImageView's picture after 2 sec, and 5?
<p>I have an ImageView, what shows one picture . I tried to use a thread, but it doesn't change the picture. Then I tried a handler, but it doesn't treat the sleep(int) method, so I can't increase the time, what elapsed. How can I make it? Can you write an example please?</p>

<p>Here is my original code: </p>

<pre><code>@Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
                Thread timer = new Thread() {
                    public void run() {
                        int time = 0;
                        while (time &lt;= 7000) {
                            try {
                                sleep(100);
                                time =+ 100;
                                if(time == 2000) {
                                    radar.setImageResource(R.drawable.radar_full);
                                }
                                if(time == 5000) {
                                    radar.setImageResource(R.drawable.radar_50);
                                }
                                if(time == 7000) {
                                    radar.setImageResource(R.drawable.radar_found);
                                }
                            } catch (InterruptedException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();


        }
};
                    timer.start();
                    };
                };
</code></pre>
