关于Android中new Notification

目前 Android 已经不推荐使用下列方式创建 Notification实例:

1 Notification notification = new Notification(R.drawable.ic_launcher,"This is ticker text",System.currentTimeMillis());

最好采用下列方式:

                Notification notification = new Notification.Builder(this)
                    .setContentTitle("This is title")
                    .setContentText("This is content")
                    .setSmallIcon(R.drawable.ic_launcher)
                        .setTicker("This is ticker")
                        .setContentIntent(pi)
                    .build();
   

 

posted @   itoysk  阅读(507)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示