Q: Kotlin putExtra none of the following functions can be called with the arguments supplied Complete Newbie to Kotlin, trying to get three values to pass across from textboxes to another page , im getting no errors put the info is not either being passed across or displayed i have tried for hours to get this to work with no avail.
Could someone point me in a good or right direction please.
I have now edited my code as given in the help below on the page that is now receiving the info i cannot get it to display.
PAGE1

package com.example.james.visitorapp

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.provider.AlarmClock.EXTRA_MESSAGE
import android.view.View
import android.widget.EditText

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    /** Called when the user taps the Send button */
    fun sendMessage(view: View) {
        val editText = findViewById<EditText>(R.id.editText)
        val editText2 = findViewById<EditText>(R.id.editText2)
        val editText3 = findViewById<EditText>(R.id.editText3)
        val message1 = editText.text.toString()
        val message2 = editText2.text.toString()
        val message3 = editText3.text.toString()


        val intent = Intent(this, DisplayMessageActivity::class.java).apply {
            putExtra(EXTRA_MESSAGE, arrayOf(message1, message2, message3))
        }

        startActivity(intent)
    }
}

receiving page

package com.example.james.visitorapp

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.provider.AlarmClock.EXTRA_MESSAGE
import android.widget.TextView

class DisplayMessageActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_display_message)

        // Get the Intent that started this activity and extract the string
        val message1 = intent.getStringExtra(EXTRA_MESSAGE)
        val message2 = intent.getStringExtra(EXTRA_MESSAGE)
        val message3 = intent.getStringExtra(EXTRA_MESSAGE)
        // Capture the layout's TextView and set the string as its text
        val textView = findViewById<TextView>(R.id.textView).apply {
            text = message1

        }
        val textView2 = findViewById<TextView>(R.id.textView2).apply {
            text = message2

        }
        val textView3 = findViewById<TextView>(R.id.textView3).apply {
            text = message3

        }
    }
}


A: please try this one
val intent = Intent(this, DisplayMessageActivity::class.java)
intent.putExtra(EXTRA_MESSAGE_1, message1)
intent.putExtra(EXTRA_MESSAGE_2, message2)
intent.putExtra(EXTRA_MESSAGE_3, message3)


A: putExtra() does not have any overloads that expect vararg.
You could either send the messages in an Array:
putExtra(EXTRA_MESSAGES, arrayOf(message1, message2, message3))

And obtain them with getStringArrayExtra() in the receiving Activity, for example:
// the inferred type of messages will be Array<String>
val messages = intent.getStringArrayExtra(EXTRA_MESSAGES)
// joining the messages into a single String and setting it as the text for the TextView
textView.text = messages.joinToString(separator = " ")

Or put them separately with different keys:
putExtra(EXTRA_MESSAGE_1, message1)
putExtra(EXTRA_MESSAGE_2, message2)
putExtra(EXTRA_MESSAGE_3, message3)

(and obtain then one by one with getStringExtra())
On a side note, calling apply() is redundant here (in both cases), you could just call putExtra() on the Intent instance directly:
val intent = Intent(this, DisplayMessageActivity::class.java)
    .putExtra(EXTRA_MESSAGE_1, message1)
    .putExtra(EXTRA_MESSAGE_2, message2)
    .putExtra(EXTRA_MESSAGE_3, message3)

