【发布时间】:2020-08-05 17:32:34
【问题描述】:
收到通知后,我想打开我的应用程序并导航到详细信息片段,因为我正在使用来自 jetpack 的导航组件,但我不知道如何实现它?
这是我的通知服务代码
val intent = Intent(this, DetailedFragment::class.java)
val builder = NotificationCompat.Builder(this, "100")
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle(rm.data["title"])
.setContentText(rm.data["body"])
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setCustomContentView(nmrv)
.setCustomBigContentView(exrv)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
val manager = NotificationManagerCompat.from(this).notify(100, builder.build())
【问题讨论】:
标签: android kotlin firebase-cloud-messaging android-notifications