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

Apps Notification builder

MunterMan

Newbie
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.
 
Back
Top Bottom