Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- intentNotification.addFlags(android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP);
- intentNotification.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- PendingIntent pendingIntent = PendingIntent.getActivity(this, 50, intentNotification, PendingIntent.FLAG_UPDATE_CURRENT);
- NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this.getApplicationContext())
- .setContentTitle(dataTitle)
- .setContentText(dataBody)
- // .setLargeIcon(getBitmapicon(getApplicationContext()))
- .setSmallIcon(getNotificationIcon())
- // .setLargeIcon(icon(getApplicationContext()))
- .setStyle(new NotificationCompat.BigPictureStyle()
- .bigPicture(image))
- .setLights(Color.LTGRAY, 1000, 1000)
- .setAutoCancel(true)
- .setTicker(dataTitle)
- .setContentIntent(pendingIntent)
- .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
- Notification notification = notificationBuilder.build();
- notification.flags = notification.flags | Notification.FLAG_SHOW_LIGHTS;
- nManager.notify((int) SystemClock.currentThreadTimeMillis(), notification);
Add Comment
Please, Sign In to add comment