La notification Android ne fonctionne pas

J'ai été de tenter d'obtenir une notification de réussite d'une importation à partir d'un ASyncTask pour travailler toute la journée. Je ne reçois pas toutes les erreurs de mon code actuel, mais je ne peux pas obtenir la notification à afficher dans la barre de notification (ou n'importe où ailleurs). Je n'ai pas de messages dans le LogCat et pas de notification apparaît dans la barre de Notification. C'est mon code:

Notification mNotification = new Notification(icon, tickerText, when);

CharSequence contentTitle = "upload completed.";
CharSequence contentText = "upload completed.";

Intent notificationIntent = new Intent(context, CastrActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_NO_CREATE);
mNotification.contentIntent = contentIntent;
mNotification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mNotification);

Cela s'appelle de la onPostExecute() méthode d'une ASyncTask. Je suis un peu confus sur le PendingIntent partie, pour être honnête. Une clarification de ce que je soupçonne d'être mauvais code, il serait grandement apprécié.

source d'informationauteur Carnivoris | 2012-01-27