第一步:(不管哪种方式都要先得到通知管理器的实例)
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
一,普通通知栏:
代码如下:
Notification.Builder builder=new Notification.Builder(this);
Intent intent=new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.jianshu.com/p/82e249713f1b"));
PendingIntent pendingIntent=PendingIntent.getActivity(this,0,intent,0);
builder.setContentIntent(pendingIntent);
builder.setSmallIcon(R.mipmap.ic_launcher);
builder