In different Kotlin examples for Android I see toast("Some message...")
or toastLong("Some long message")
. For example:
Try this
In Activity
Toast.makeText(applicationContext, "Test", Toast.LENGTH_LONG).show()
or
Toast.makeText(this@MainActiivty, "Test", Toast.LENGTH_LONG).show()
In Fragment
Toast.makeText(activity, "Test", Toast.LENGTH_LONG).show()
or
Toast.makeText(activity?.applicationContext, "Test", Toast.LENGTH_LONG).show()