【报错】"The constructor Notification(int, CharSequence, long) is deprecated

Notification的构造方法 Notification(int, CharSequence, long) 在API11之后就淘汰了,之后的API需要用Notification.Builder()方法:

Notification notification = new Notification.Builder(context)
    .setContentText(CharSequence)
    .setSmallIcon(int)
    .setWhen(long)
    .build();


原文地址:https://www.cnblogs.com/yidan621/p/5670524.html