Guest User

Untitled

a guest
May 23rd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. builder = new NotificationCompat.Builder(Objects.requireNonNull(getContext()),"M_CH_ID");
  2. builder.setSmallIcon(R.drawable.icon_notificacao)
  3. .setContentTitle("RPfm 105.3")
  4. .setContentText("Ao Vivo")
  5. .setAutoCancel(true);
  6. NotificationManager notifyManager = (NotificationManager) Objects.<FragmentActivity>requireNonNull(getActivity()).getSystemService(Context.NOTIFICATION_SERVICE);
  7. if(notifyManager != null) {
  8. notifyManager.notify(1, builder.build());
  9. }
Add Comment
Please, Sign In to add comment