Skip to content

ToastExtensions

BirjuVachhani edited this page Feb 13, 2019 · 1 revision

List of classes from where toast can be called direcly:

  • Activities/AppCompatActivities
  • Fragments
  • AlertDialogs

Other than that, toast can be called from block of code that has access to context instance.

Examples

//shows toast for a short duration
toast(25.8)
toast("This is a simple toast!")
toast(true)
// shows toast with for a long duration
longToast(48.2)
longToast("This is a bit long toast!")

For more information, look at the ToastExtensions.kt file.