private void listing11_25(Context context, NotificationCompat.Builder builder, Uri chatThreadUri) { // Listing 11-25: Adding a direct reply action // The key you'll use to later retrieve the reply final String KEY_TEXT_REPLY = "KEY_TEXT_REPLY"; Intent replyAction = new Intent(context, ReplyBroadcastReceiver.class); replyAction.setData(chatThreadUri); PendingIntent replyIntent = PendingIntent.getBroadcast(context, 0, replyAction, PendingIntent.FLAG_UPDATE_CURRENT); // Construct the RemoteInput RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY) .setLabel(context.getString(R.string.reply_hint_text)) .build(); builder.addAction( new NotificationCompat.Action.Builder( R.drawable.reply, context.getString(R.string.reply_action), replyIntent) .addRemoteInput(remoteInput) .setAllowGeneratedReplies(true) .extend(new NotificationCompat.Action.WearableExtender() .setHintDisplayActionInline(true)) .build()); }