Skip to content

Android Notification

ythy edited this page Oct 19, 2017 · 2 revisions

the constructor for Notification which is deprecated as of API 11. Meaning it isn't supported any longer and should not be used. use Notification.Builder instead

bad:

Notification notification = new Notification(icon, message, when);

right:

Notification notification = new Notification.Builder(context)
    .setContentText(message)
    .setSmallIcon(icon)
    .setWhen(when)
    .build();
Clone this wiki locally