How do you display a Toast using Kotlin on Android?

前端 未结 15 2344
遇见更好的自我
遇见更好的自我 2021-01-30 16:08

In different Kotlin examples for Android I see toast("Some message...") or toastLong("Some long message"). For example:



        
15条回答
  •  耶瑟儿~
    2021-01-30 16:14

    It's simply an extension function for Context (like other pointed out already).

    You can find a lot of pre-defined android extension functions in Anko, which is probably what many of the tutorials use as well.

提交回复
热议问题