如何从builder.setmessage获取Kotlin的ID

时间:2019-06-21 06:36:05

标签: android mobile kotlin

如何将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)
            }
        }

0 个答案:

没有答案