title: how to Display Image automatically after a random time
body: <p>I build a android application in which i want display image one by one after a random time.
  means</p>
  
  <p>image 1 show</p>
  
  <p>after 10 sec</p>
  
  <p>image 2 show</p>
  
  <p>after 30 sec</p>
  
  <p>image 3 show</p>
  
  <p>after 50 sec</p>
  
  <p>image 4 show</p>
  
  <p>i have code for displaying image but it shows images continuously every 10 sec while i want image show after a random time.</p>
  
  <pre><code>public class MainActivity extends Activity {
    ImageView imageView;
  
  
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
       imageView = (ImageView) findViewById(R.id.imageView1);
       final int []imageArray=
         {R.drawable.a,R.drawable.b,R.drawable.c,R.drawable.d,R.drawable.e};
  
  
         final Handler handler = new Handler();
          Runnable runnable = new Runnable() {
          int i=0;
          public void run() {
              imageView.setImageResource(imageArray[i]);
              i++;
              if(i&gt;imageArray.length-1)
              {
              i=0;    
              }
              handler.postDelayed(this, 10000);  //for interval...
           }
  
         };
        handler.postDelayed(runnable, 10000); //for initial delay..
  
        }
  </code></pre>
  
  <p>xml file is-</p>
  
  <pre><code>     &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".MainActivity" &gt;
  
  &lt;ImageView
      android:id="@+id/imageView1"
      android:layout_width="match_parent"
      android:layout_height="match_parent"/&gt;
  
    &lt;/RelativeLayout&gt;
  </code></pre>