makeToast

fun Context.makeToast(@StringRes text: Int, duration: Int = Toast.LENGTH_SHORT): Toast

Creates a Toast from a string resource.

This resolves the resource before delegating to Toast.makeText, while still returning the toast for further customization.


fun Context.makeToast(text: CharSequence, duration: Int = Toast.LENGTH_SHORT): Toast

Creates a Toast from text.

This keeps toast construction concise while returning the toast when callers need to configure it before showing.