Cordova状态栏通知插件错误

ari*_*v22 7 eclipse android phonegap-plugins cordova

我正在尝试将Cordova的状态栏通知插件添加到我的Android应用程序中,但是我的代码出错了.

这是有问题的代码:

  Notification noti = new Notification.Builder(context)
    .setContentTitle(contentTitle)
    .setContentText(contentText)
    .setSmallIcon(icon)
    .build();
Run Code Online (Sandbox Code Playgroud)

错误发生了.build(),Eclipse告诉我:

"Notification.Builder类型的方法build()未定义"

joh*_*182 13

我有相同的问题.它看起来像sdk版本和现在折旧的方法不匹配.

getNotification()是自API 16中添加API 11 build()以来调用的方法

如果你像我一样,你使用的版本<16,所以请改用.getNotification().

我现在不会担心API 16,但我打赌如果我下载16并将我的目标设置为这样,build()将起作用.

请让我知道这对你有没有用.