In different Kotlin examples for Android I see toast("Some message...") or toastLong("Some long message"). For example:
If you don't want to use anko and want to create your own Toast extension. You can create inline(or without inline) extensions defined in a kotlin file(with no class) and with that you can access this function in any class.
inline fun Context.toast(message:String){
Toast.makeText(this, message , duration).show()
}
Usage:
In Activity,
toast("Toast Message")
In Fragment,
context?.toast("Toast Message")