NotificationManager

代码
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        Notification notification 
= new Notification(R.drawable.icon, "您有新消息了", System.currentTimeMillis());
        PendingIntent contentIntent 
= PendingIntent.getActivity(this0, getIntent(), 0);
        notification.setLatestEventInfo(
this"天气预报""晴转多云", contentIntent);
        notificationManager.notify(R.drawable.icon, notification);
原文地址:https://www.cnblogs.com/mobile/p/1944664.html