Notification notification = new Notification(R.drawable.icon, "嘎你妹", System.currentTimeMillis());
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent ii = new Intent();
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, ii, PendingIntent.FLAG_UPDATE_CURRENT);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.defaults = Notification.DEFAULT_SOUND;
Intent i = new Intent("com.android.broadcasttest.xxx");//已有广播
notification.deleteIntent = PendingIntent.getBroadcast(this, 0,i, 0);
notification.setLatestEventInfo(context, "嘎嘎消息",
String.format("共%d条新消息", 1), contentIntent);
nm.notify(R.string.app_name, notification);