, wenn ich auf die Benachrichtigung selbst klicke und die Aktionsschaltfläche tut es gleich, ich möchte zwischen ihnen unterscheiden, ich möchte die Schaltfläche etwas tun und wenn ich klicke die Benachrichtigung selbst etwas anderes, hier ist mein Code-wie man zwischen Benachrichtigung bei Klick und auf Benachrichtigung unterscheidet, klicken Sie
Intent intent = new Intent(this, NotificationView.class);
PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setTicker(getString(R.string.notificationticker))
.setContentTitle(getString(R.string.notificationtitle))
.setContentText(yeah)
.addAction(R.drawable.ic_favorite, getString(R.string.azor), pIntent)
.setContentIntent(pIntent)
.setAutoCancel(true);
NotificationManager notificationmanager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationmanager.notify(0, builder.build());
Haha danke! –