Here's my issue..
I have an AlarmManager with a Timer, which fires a Receiver when the timer expires..
When the Timer expires, and the onReceive is fired within the Receiver, I want to create a NOTIFICATION in the Notification Bar.. However, for some reason I'm having issues..
For example, the word this
is always underlined in red..
I was able to replace SOME of them with context
to get rid of some errors,
however there are a couple places where I am still having issues..
I'm definitely doing a few things incorrectly, and could really use some help!
The following is my Code, within the Receiver's onReceive method..
Any advice would be greatly appreciated! Thank you!
(PS.. When clicked, I want it to open the Location/GPS Settings screen)..
// Sets an ID for the notification
int mNotificationId = 001;
NotificationManager mNotifyMgr =
(NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_notification_messageboxes)
.setContentTitle("TITLE OF NOTIFICATION")
.setContentText("Description text of the notification");
Intent resultIntent =
new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
PendingIntent resultPendingIntent =
PendingIntent.getActivity
(context, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPendingIntent);
mNotifyMgr.notify(mNotificationId, mBuilder.build());