60.6 Creating the Intent
The objective for MainActivity is to create and start an intent when the user touches the “Send Text” button. As part of the intent creation process, the question string entered by the user into the EditText view will be added to the intent object as a key-value pair. When the user interface layout was created for MainActivity, the button object was configured to call a method named sendText() when “clicked” by the user. This method now needs to be added to the MainActivity class MainActivity.kt source file as follows:
package com.ebookfrenzy.explicitintent
.
.
import android.view.View
import android.content.Intent
class MainActivity : AppCompatActivity() {
.
.
fun sendText(view: View) {
val i = Intent(this, SecondActivity::class.java)
val myString...