Notification

Notification noti = new Notification.Builder(this)              
         .setContentTitle(methodName + " " + strings[strings.length - 1])   //设置Notification标题,
     .setAutoCancel(true)                            //设置Notification 提醒属性 .setSmallIcon(R.mipmap.ic_launcher)                  // 设置Notification 图标 .setContentText(name).build();                     //设置Notification 内容 NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); //NotificationManager 管理对象 通过获取系统服务来得到 notificationManager.notify((int) System.currentTimeMillis(), noti);   //通过管理者来发送notification 对象。

 

posted @ 2017-07-24 21:28  halo-漾  阅读(117)  评论(0编辑  收藏  举报