I'm working on a simple project which sends push notifications.
I wanted to design my notification a bit by setting colors, icons etc.
According to Android Developer site, there's a method to NotficationCompat.Builder
class called setColor
and setCategory
, but both give me a compilation error.
I've updated the android.support.v4....
to the latest one, any more ideas?
Thanks in advance
EDIT: Here's a code snippet of the issue:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.setDefaults(defaults)
.setSmallIcon(R.drawable.icon)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.alert))
.setColor(Color.RED) // The error is here!!!
//.setCategory(Notification.CATEGORY_ALARM)
.setWhen(System.currentTimeMillis())
.setSubText("Tap here for more details")
.setContentTitle("Care@Home Alert")
.setTicker("Care@Home Alert")
.setContentIntent(contentIntent)
.setAutoCancel(true);
The exact error is copied to the question title.
Updated: The issue is that the support library wasnt updated to the latest version.