Guest User

Untitled

a guest
Jan 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. intentNotification.addFlags(android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP);
  2. intentNotification.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  3. PendingIntent pendingIntent = PendingIntent.getActivity(this, 50, intentNotification, PendingIntent.FLAG_UPDATE_CURRENT);
  4. NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this.getApplicationContext())
  5. .setContentTitle(dataTitle)
  6. .setContentText(dataBody)
  7. // .setLargeIcon(getBitmapicon(getApplicationContext()))
  8.  
  9. .setSmallIcon(getNotificationIcon())
  10. // .setLargeIcon(icon(getApplicationContext()))
  11. .setStyle(new NotificationCompat.BigPictureStyle()
  12. .bigPicture(image))
  13. .setLights(Color.LTGRAY, 1000, 1000)
  14. .setAutoCancel(true)
  15. .setTicker(dataTitle)
  16. .setContentIntent(pendingIntent)
  17. .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
  18.  
  19. Notification notification = notificationBuilder.build();
  20. notification.flags = notification.flags | Notification.FLAG_SHOW_LIGHTS;
  21. nManager.notify((int) SystemClock.currentThreadTimeMillis(), notification);
Add Comment
Please, Sign In to add comment