The documentation says Notification.Builder is Added in API level 11. Why I get this lint error?
Call requires API level 16 (current min is 14): android.app.Notification.Builder#build
notification = new Notification.Builder(ctx)
.setContentTitle("Title").setContentText("Text")
.setSmallIcon(R.drawable.ic_launcher).build();
Manifest:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
Am I missing something?
Correct me if I am wrong but the API is added in level 11, right? Added in API level 11
NotificationBuilder.build() requires API Level 16 or higher. Anything between API Level 11 & 15 you should use NotificationBuilder.getNotification(). So use
notification = new Notification.Builder(ctx)
.setContentTitle("Title").setContentText("Text")
.setSmallIcon(R.drawable.ic_launcher).getNotification();