private void showToast(String message)
{
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
}
Should I change to getActivity()
?
getApplicationContext()
must be called on an instance of a Context
class, so yes, you should call:
getActivity().getApplicationContext()
You can also just pass getActivity
as the first parameter since the activity itself extends Context
class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With