Ant can't find method build of Notification.Builder (android) -


i followed this guide make notification using code on sdk-17 (minsdk 13) intentservice class.

private final int notification_id=6317; notifiaction.builder builder; private void startnotification(int backupnumber) {     builder=new notification.builder(this);     builder.setcontenttitle("backup");     builder.setcontenttext(getstring(r.string.backup_of)+backupnumber+"app(s)");     builder.setsmallicon(android.r.drawable.stat_sys_download);     intent notificationintent = new intent(this, launchalot.class);     pendingintent pendingintent = pendingintent.getactivity(this, 0, notificationintent, 0);     builder.setcontentintent(pendingintent);     mnotificationmanager =(notificationmanager) getsystemservice(context.notification_service);     startforeground(notification_id, builder.build()); } 

i use builder.build() in other methods, update notification

when try compile ant can't find build() method:

[javac] /home/edo/dropbox/android_projects/appshare/src/it/ptia/appshare/backupservice.java:44: error: cannot find symbol [javac]                 mnotificationmanager.notify(notification_id, builder.build()); [javac]                                                          ^ [javac]   symbol:   method build() [javac]   location: variable builder of type builder [javac] /home/edo/dropbox/android_projects/appshare/src/it/ptia/appshare/backupservice.java:65: error: cannot find symbol [javac]             mnotificationmanager.notify(notification_id, builder.build()); [javac]                                                      ^ [javac]   symbol:   method build() [javac]   location: variable builder of type builder [javac] /home/edo/dropbox/android_projects/appshare/src/it/ptia/appshare/backupservice.java:107: error: cannot find symbol [javac]         startforeground(, builder.build()); [javac]                                      ^ [javac]   symbol:   method build() [javac]   location: variable builder of type builder [javac] 3 errors 

the build() call api 16 , min 13

you can use getnotification when api lower 16


Comments