I'm having a problem and I'm not getting any better. The problem is this: I have a Fragment in my app, and I want to trigger a notification from it. The line I'm having problems with is this: NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
The error is in getSystemService()
, the IDE tells me that "The getSystemService(String)
method is undefined for type MinhaClasseFragment
"
I have tried to get and pass contexts, until I use Context
receiving getActivity()
and nothing.
I searched the web and found nothing that would help me. What to do?