The syntax is very simple. The example below is invoked from inside a Fragment, so the first parameter (Context) is the activity that holds the fragment:


The second parameter is the message, the third is the duration, Toast.makeText returns an instance of Toast, that we “.show()” immediately.

Pin It on Pinterest

Share This