小编Tin*_*ink的帖子

如何为 Android Direct Reply 设置 inputType

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

如何指定直接回复的键盘?就像我们为 EditText 所做的一样

            android:inputType="phone"
Run Code Online (Sandbox Code Playgroud)

我只是从官方教程中复制代码, 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();
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

android

5
推荐指数
0
解决办法
174
查看次数

标签 统计

android ×1