title: random image in Android?
body: <p>I am trying to make a view with random images. I have code and no errors but when I click the button to go to the random image it just stays the same.</p>
  
  <p>My source is:</p>
  
  <pre><code>private static final Random rgenerator = new Random();
  
  private static final Integer[] mImageIds = 
      { R.drawable.img2, R.drawable.img1, R.drawable.img3, };
  
  @Override
  public void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      Integer q = mImageIds[rgenerator.nextInt(mImageIds.length)];
      ImageView iv = (ImageView) findViewById(R.id.imageviewyeah);
      iv.setTag(q);
  
      View nextButton = findViewById(R.id.next_image_button);
      nextButton.setOnClickListener(this);
  }
  
  public void onClick(View v)
  {
      switch (v.getId())
      {
          case R.id.next_image_button:
              Intent i = new Intent(this, RandomImage.class);
              startActivity(i);
              break;
      }
  }
  </code></pre>