该方法构建()是未定义的类型Notification.Builder [英] The method build() is undefined for the type Notification.Builder
问题描述
错误:该方法构建()是未定义的类型Notification.Builder
我已经加入Android的支持 - v4.jar还是我的错误?
的通知的通知=新Notification.Builder(上下文)
.setContentText(消息)
.setContentTitle(context.getString(R.string.app_name))
.setSmallIcon(图标)
.setWhen(时)
.setContentIntent(意向).build();
我的猜测是,你的 Android的支持 - v4.jar
太旧。 建立()
加入大约一年前,但经过好支持Android包是首次发布。
请确保你有你的SDK管理器下载了最新的Android支持包,然后拷贝过来的最新 Android的支持 - v4.jar
从演员/
目录中的SDK到您的项目。
Error: The method build() is undefined for the type Notification.Builder
I have add android-support-v4.jar still I got error ?
Notification notification = new Notification.Builder(context)
.setContentText(message)
.setContentTitle(context.getString(R.string.app_name))
.setSmallIcon(icon)
.setWhen(when)
.setContentIntent(intent).build();
My guess is that your android-support-v4.jar
is too old. build()
was added about a year ago, but well after the Android Support package was first released.
Ensure that you have the latest Android Support package downloaded in your SDK Manager, then copy over the latest android-support-v4.jar
from the extras/
directory of your SDK into your project.
这篇关于该方法构建()是未定义的类型Notification.Builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!