Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NotificationCompat.Builder missing build() method

I want to do exactly, what he does: Android Notification at time But in my AlarmReceiver class, I have an error: The method build() is undefined for the type NotificationCompat.Builder, at line: mNotificationManager.notify(1, mBuilder.build());

In android developer site is a similar code, but the same error appears(http://developer.android.com/training/notify-user/build-notification.html).

Any help is greatly appreciated.

like image 256
mate1229 Avatar asked Dec 08 '22 14:12

mate1229


2 Answers

You may be on an older version of the Android Support package. Make sure that your project has a current copy of android-support-v4.jar or android-support-v13.jar in libs/.

like image 166
CommonsWare Avatar answered Dec 11 '22 02:12

CommonsWare


It appears that there's a broken version of the Android Support package out there. Specifically, the one currently being deployed in ActionBarSherlock.

I'd recommend always using the latest android-support-v4.jar from inside the Android SDK. You'll find it in [android-sdk]/extras/android/support/v4.

like image 33
Paul Lammertsma Avatar answered Dec 11 '22 02:12

Paul Lammertsma