我正在为少于O API的代码编写代码,并将此代码用于应用内通知。一切进展顺利,但我混淆了如何在此通知代码中使用意图。通知即将到来,但如何连接意图。请解决我的问题。我的代码是:
NotificationCompat.Builder notificationbuilder=new NotificationCompat.Builder(AppinNotification.this)
.setSmallIcon(R.drawable.app_logo)
.setContentTitle("This is the title")
.setContentText("Hello new update");
notificationbuilder.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE);
NotificationManagerCompat notificationManagerCompat=NotificationManagerCompat.from(AppinNotification.this);
notificationManagerCompat.notify(1,notificationbuilder.build());
startActivity(intent);