Sms Gratis Indosat

Phone Numbers
0 -
Example : 83832867987 Without 0

Type your Messages

Question: + =

Create a PendingIntent for Notification to do nothing

Refer to the last post "error of using NotificationCompat.Builder, IllegalArgumentException: contentIntent required", if you want no action perform when user click on the Notification, you can insert a PendingIntent with a dummy Intent.

Example:


PendingIntent pendingIntent = PendingIntent.getActivity(
MainActivity.this,
0,
new Intent(), //Dummy Intent do nothing
Intent.FLAG_ACTIVITY_NEW_TASK);

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 articles :

0 comments:

Post a Comment

 
Copyright © 2015. About - Web Version - Mobile Version Sitemap - Contact - Privacy