如何将Intent连接到In-APP通知

时间:2018-08-27 16:34:00

标签: android android-intent notifications

我正在为少于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);

0 个答案:

没有答案