Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old September 27th, 2012, 09:33 AM   #1 (permalink)
New Member
Thread Author (OP)
 
MunterMan's Avatar
 
Join Date: Mar 2012
Location: Manchester, England
Posts: 7
 
Device(s): Sony Xperia Tipo
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Notification builder

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

PHP Code:
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.

MunterMan is offline  
Last edited by MunterMan; September 27th, 2012 at 09:44 AM. Reason: My bad, wrong api
Reply With Quote
Sponsors
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:27 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.