Toasts are such a useful tool when developing an application, especially when learning a new language, that we're going to revisit the Toast. This recipe will show you the Kotlin way of displaying the very familiar Toast, as shown here:
Creating a Toast in Kotlin
Getting ready
Create a new project in Android Studio and call it KotlinToast. Use the default Phone & Tablet options and select Empty Activity when prompted for the Activity Type. Remember to check the Include Kotlin support checkbox in the Create Android Project dialog.