title: how to create random UUID in Android when button click event happens?
body: <p>I am an apprentice to Android. I need to make random UUID and store to the database as a primary key. I am utilizing UUID.randomUUID.toString() this code in Button click event. The UUID has been effectively made interestingly. Yet, in the event that I click the button once more, I need to make another UUID. In any case, my code is not making new UUID. Somebody, please help me to make an irregular UUID when I click catch. </p>
  
  <p>Here is my code :</p>
  
  <pre><code>String uniqueId = null;
  showRandomId = (Button)findViewById(R.id.showUUID);
  showRandomId.setOnClickListener(new View.OnClickListener() {
    public void OnClick(View v) {
      if(uniqueId == null) {
         uniqueId = UUID.randomUUID().toString();
      }
      int duration = Toast.LENGTH_SHORT;
      Toast toast = Toast.makeText(getBaseContext(), uniqueId, duration);
      toast.show(); 
    }
  });
  </code></pre>