Notification by clicking the button

Asked

Viewed 44 times

1

builder = new NotificationCompat.Builder(Objects.requireNonNull(getContext()),"M_CH_ID");
    builder.setSmallIcon(R.drawable.icon_notificacao)
            .setContentTitle("RPfm 105.3")
            .setContentText("Ao Vivo")
            .setAutoCancel(true);
    NotificationManager notifyManager = (NotificationManager) Objects.<FragmentActivity>requireNonNull(getActivity()).getSystemService(Context.NOTIFICATION_SERVICE);
    if(notifyManager != null) {
        notifyManager.notify(1, builder.build());
    }

This code was working before updating the android studio. Someone Sab oq might be. In the Log no nda error, and already debugged, it calls the method, no longer displays the notification.

  • 1

    Which API is using ?

  • I’m using version 27

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.