如何为Android Direct Reply设置inputType

时间:2017-07-11 08:45:08

标签: android

我正在为我的Android应用实施直接回复。在我的应用程序中,我希望用户只在通知直接回复中输入数字。默认情况下,此回复的键盘是文本。因此,用户输入数字并不容易。

如何指定键盘以进行直接回复?就像我们为EditText做的那样

            android:inputType="phone"

我只是复制官方教程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 个答案:

没有答案