• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Notification builder

I found this problem.
Get the sample code from developer.android.com

PHP:
Notification noti = new Notification.Builder(mContext)
         .setContentTitle("New mail from " + sender.toString())
         .setContentText(subject)
         .setSmallIcon(R.drawable.new_mail)
         .setLargeIcon(aBitmap)
         .build();


and when you put it into eclipse you get this error.

"The method build() is undefined for the type Notification.Builder"

Turns out I was using the wrong api. This only works with api 16 or greater, I was using 15.
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones