Slide 34
Slide 34 text
Direct Reply
val action = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val remoteInput = RemoteInput.Builder(KEY_REMOTE_INPUT)
.setLabel("Reply Label")
.build()
val replyIntent = Intent(context, MyBroadcastReceiver::class.java)
val replyPendingIntent = PendingIntent.getBroadcast(context, 1001,
replyIntent, PendingIntent.FLAG_UPDATE_CURRENT)
NotificationCompat.Action.Builder(R.drawable.ic_action_reply, "Reply",
replyPendingIntent)
.addRemoteInput(remoteInput)
.build()
} else {
NotificationCompat.Action.Builder(R.drawable.ic_action_reply, "Reply",
pendingIntent)
.build()
}