nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Intent myIntent =
new
Intent(getApplicationContext(), WeatherNotificationMessage.
class
);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(
getApplication(),
0
, myIntent,
0
);
String ticker =
"ticker"
;
String title =
"title"
;
String text =
"text"
;
Notification notification =
new
Notification(android.R.drawable.ic_dialog_alert,
ticker, System.currentTimeMillis());
notification.setLatestEventInfo(getApplication(),
title, text, intent);
nm.notify(
0001
, notification);