How to set inputType for Android Direct Reply

Viewed 235

I'm implementing Direct Reply for my Android App. In my App, I want users only input numbers in the notification Direct Reply. By Default, the keyboard for this reply is text. So it's not easy for users to input numbers.

How can I specify the keyboard for direct reply? Like what we do for EditText

            android:inputType="phone"

I just copy the code from the official tutorial, https://developer.android.com/guide/topics/ui/notifiers/notifications.html#direct

// Key for the string that's delivered in the action's intent.
private static final String KEY_TEXT_REPLY = "key_text_reply";
String replyLabel = getResources().getString(R.string.reply_label);
RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY)
    .setLabel(replyLabel)
    .build();

enter image description here

0 Answers
Related