【发布时间】:2013-05-08 16:37:23
【问题描述】:
文档说 Notification.Builder 是在 API 级别 11 中添加的。 为什么我会收到此 lint 错误?
调用需要 API 级别 16(当前最低为 14):android.app.Notification.Builder#build
notification = new Notification.Builder(ctx)
.setContentTitle("Title").setContentText("Text")
.setSmallIcon(R.drawable.ic_launcher).build();
清单:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
我错过了什么吗?
如果我错了,请纠正我,但 API 是在第 11 级添加的,对吗? Added in API level 11
【问题讨论】:
-
tools.android.com/tips/lint-checks。它的 lint 警告通知生成器需要 api 16
-
向下滚动同一页面并查看公共方法下方的主题
-
谢谢。 build 方法是在第 16 级添加的...
标签: android android-lint