title: How to have unique random number?
body: <p>This is how i am generating a unique no in between 1 to 6 and getting appropriate images from the drawable folder.  </p>
  
  <pre><code>Random rand = new Random();
  // n = the number of images, that start at idx 1
  rndInt = rand.nextInt(6) + 1; 
  String imgName = "card" + rndInt;
  int id = getResources().getIdentifier(imgName, "drawable", getPackageName());
  imgView.setImageResource(id);
  </code></pre>
  
  <p>What i want is, I have to call this method 7 times, and each time this method should return a unique random no. so that none of the already chosen numbers will come up again.</p>