title: Comparing two integers in android
body: <p>I want to compare two sets of digits. The first I will generate as a random in code. The second will be entered into an EditText.</p>
  
  <p>I wish to compare the two numbers and see if they match.</p>
  
  <p>Random number:</p>
  
  <pre><code>public static int random() {
     if (randomNumberGenerator == null)
        initRNG();
  
     return randomNumberGenerator.nextInt();
  }
  
  private static Random randomNumberGenerator;
  private static synchronized void initRNG() {
     if (randomNumberGenerator == null)
        randomNumberGenerator = new Random();
  }
  </code></pre>
  
  <p>Showing randomly selected number</p>
  
  <pre><code>display = (TextView) findViewById (R.id.textView1);
  display.setText ("Random Number:" + random ());
  </code></pre>
  
  <p>How can I compare the two numbers?</p>