The makeText's signature is the following
public static Toast makeText (Context context, CharSequence text, int duration)
the first paramter has to be a context object. You put this
, but this
refers to this object and it can be something different from an Activity
(a Fragment
for instance).