notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Intent intent = new Intent(IslogInActivity.this,LogInActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification;
Notification.Builder builder;
//Api大于等于HONEYCOMB,使用Notification.Builder创建notification
builder = new Notification.Builder(IslogInActivity.this)
.setSmallIcon(R.mipmap.point_icon)//图标
.setContentTitle("卫龙卖衣服啦")//标题
.setContentText(getString(R.string.demo))//内容
.setAutoCancel(true)//点击清除
.setContentIntent(pendingIntent)//跳转Activity
.setWhen(System.currentTimeMillis())
.setDefaults(Notification.DEFAULT_ALL);//震动,声音等默认效果
notification = builder.build();
notificationManager.notify(1, notification);
参考文章点击打开链接