title: how to change images on imageView after some interval
body: <p>I have a problem that I want to paste images on ImageView in Android and that images are periodically changed after some interval. Means one by one images shown in ImageView. I am doing this with the help of Thread in java but I got some problem that Thread is not attached and something. Please review my code given below and tell me the exact error and how to remove that error or give me some diffrent way for doing this.</p>
  
  <pre><code>package com.ex.thread;
  
  import com.ex.thread.R;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.ImageView;
  
  public class thread extends Activity implements Runnable{
  /** Called when the activity is first created. */
  public static Integer[] mThumbIds = {
  
     R.drawable.al1,R.drawable.al2,R.drawable.al3,R.drawable.al4,
  
  };
  Thread th;
  ImageView iv;
  public void run()
  {
      for(int i=0;i&lt;3;i++)
      {
          iv.setImageResource(mThumbIds[i]);
          System.out.println("Sanat Pandey");
          try{
              Thread.sleep(3000);
          }catch(Exception e)
          {
              System.out.println(e);
          }
      }
  }
  public void create()
  {
      Thread th = new Thread(new thread());
      th.start();
      try{
          Thread.sleep(3000);
      }catch(Exception e)
      {
          System.out.println(e);
      }
  }
  
  @Override
  public void onCreate(Bundle savedInstace)
  {
      super.onCreate(savedInstace);
      setContentView(R.layout.main);
      create();
  }
  }
  </code></pre>