Simple replace Notification.Builder with NotificationCompat.Builder, and import android.support.v4.app.NotificationCompat.
myNotification = new NotificationCompat.Builder(context)
.setContentTitle("Exercise of Notification!")
.setContentText("http://android-er.blogspot.com/")
.setTicker("Notification!")
.setWhen(System.currentTimeMillis())
.setContentIntent(pendingIntent)
.setDefaults(Notification.DEFAULT_SOUND)
.setAutoCancel(true)
.setSmallIcon(R.drawable.ic_launcher)
.build();
Related:
- error of using NotificationCompat.Builder, IllegalArgumentException: contentIntent required
2 comments:
Can we Vibrate mobile when Notification is Recieve
hello chintan Patel,
Check HERE
Post a Comment