NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification.Builder builder = new Notification.Builder(this);
Intent intent = new Intent(Main2Activity.this,ReceiveMailActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
builder.setContentIntent(pendingIntent);
builder.setSmallIcon(R.drawable.logo);
builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.logo));
builder.setAutoCancel(true);
builder.setContentTitle("悬挂式通知");
builder.setFullScreenIntent(pendingIntent, true);
mNotificationManager.notify(2, builder.build());
亲测可用