Answer the question
In order to leave comments, you need to log in
How to handle button event in Notification on android?
I have a PUSH notification with a button. I can not make it so that when the button is pressed, the method would be called.
Intent iOK= new Intent(this, MainActivity.class);
PendingIntent piOK = PendingIntent.getBroadcast(this, 2, iOK, 0);
Notification notification = new NotificationCompat.Builder(getApplicationContext(), CHENEL_1_ID)
.addAction(R.raw.weewqwqe, "OK", piOK)
.build();
notificationManager.notify(1, notification);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question