# Improved notifications with Direct reply in Android N

DevFeed: [Improved notifications with Direct reply in Android N](<https://devfeed.tech/articles/improved-notifications-with-direct-reply-in-android-n-25841.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/notifications-direct-reply-android-nougat>)

Author: Segun Famisa

Published: 2016-09-25T08:42:45Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [notifications](<https://devfeed.tech/tags/notifications.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This tutorial explains Android N direct reply notifications, which let users respond inline from a notification. It describes how RemoteInput, notification actions, and PendingIntent work together and outlines the implementation steps for adding direct reply to an app.

## Source excerpt

Introduction Notifications is one feature that improves at almost every Android update. From single tap notifications, to actionable notifications, Android N also introduces some new features to Notifications in Android. Android N introduces direct reply, notification bundling and other cool features. If you have Android N installed on your device, you may have noticed the new way the notifications appear. You may also have noticed that you can reply messages in-line right from your notification. I noticed this behaviour has already been implemented on quite a number of apps including Twitter, Slack, WhatsApp. This is made possible by Direct reply. Direct reply aims to reduce the number of steps between receiving a notification and acting on it. The image below is direct reply in action on Slack for Android app. In this post, we will walk through the steps in implementing direct reply in your apps. I will cover the new notification styles and bundling notifications in another post. How it works? Direct reply makes use of a combination of notification, action and Remote Input. Once a Remote input is added to a notification, Android knows that it should request for input from the user. This happens the same way to request for voice input on Android wear 2.0. How to implement? Implementation happens in 3 major steps: 1. Add direct reply action First thing to do, is to add a direct reply action to your notification. To do this, you need to first: a. Build your label using a remote input. The remote input holds information such as the label to show for the action, and the key that will be used to retrieve the user input later on. String replyLabel = getString(R.string.notif_action_reply); RemoteInput remoteInput = new RemoteInput.Builder(KEY_REPLY) .setLabel(replyLabel) .build(); b. Build your notification action Next step is to build the notification action. This uses the NotificationCompat.Action for backwards compatibility. You will then connect the action with the re