title: How do I convert text in an EditText component to an integer?
body: <p>I am currently making a simple random number generator in Android Studio as it is my first time coding in kotlin, you put in 2 numbers, and it will pick a random number between said numbers.</p>
  <pre><code>class MainActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          val rollButton = findViewById&lt;Button&gt;(R.id.rollButton)
          val resultsTextView = findViewById&lt;TextView&gt;(R.id.resultsTextView)
          val RandNum1 = findViewById&lt;EditText&gt;(R.id.RandNum1)
          val RandNum2 = findViewById&lt;EditText&gt;(R.id.RandNum2)
  
          rollButton.setOnClickListener {
              val rand = java.util.Random().nextInt(RandNum1)
              resultsTextView.text = rand.toString()
          }
      }
  }
  </code></pre>
  <p>So currently I have the rollButton which is set to generate a random number when pressed. I also have the resultsTextView to display the chosen number. And I also have RandNum1 and RandNum2 (the user's number choice), I need to find a way to convert the text that I receive from RandNum1/2 into an integer so that I can use it for the random number generator.</p>