bsod_keks

Notification

Jul 5th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. void openNotify(String title, String msg)
  2. {
  3. NotificationCompat.Builder builder =
  4. new NotificationCompat.Builder(this)
  5. .setSmallIcon(R.mipmap.ic_launcher)
  6. .setContentTitle(title)
  7. .setContentText(msg)
  8. .setAutoCancel(true);
  9.  
  10. Notification notification = builder.build();
  11.  
  12. NotificationManager notificationManager =
  13. (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  14. notificationManager.notify(1, notification);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment