Как передать builder.setMessage("abc")
данные в txtAnswer textview
builder.setMessage("abc")
builder.setNeutralButton("PLAY") { dialog, id ->
val toSpeak = txtAnswer.toString()
if (toSpeak == ""){
//if there is no text in edit text
Toast.makeText(this, "No input", Toast.LENGTH_SHORT).show()
}
else{
//if there is text in edit text
Toast.makeText(this, toSpeak, Toast.LENGTH_SHORT).show()
mTTS.speak(toSpeak, TextToSpeech.QUEUE_FLUSH, null)
}
}