作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有一个名为 setAllowDataType
的新函数在 RemoteInput.Builder
在 API 26 中。这是做什么用的?我尝试了以下方法:
val remoteInput = RemoteInput.Builder(KEY_TEXT_REPLY)
.setLabel("Image")
.setAllowFreeFormInput(false)
.setChoices(null)
.setAllowDataType("image/*", true)
.setAllowDataType("image/png", true)
.setAllowDataType("image/jpg", true)
.setAllowDataType("image/gif", true)
.build()
isDataOnly
至
true
在
RemoteInput
,但通知在手机上显示如下。点击
Image
按钮什么都不做。这个是来做什么的?我找不到有关此功能的任何文档、发行说明或教程。
Actions
时查看构建器代码对于通知,它使用级别 24 完全去除数据类型:
https://android.googlesource.com/platform/frameworks/support/+/oreo-release/compat/api26/android/support/v4/app/NotificationCompatApi26.java#108
最佳答案
来自 docs它说:
Specifies whether the user can provide arbitrary values. This allows an input to accept non-textual values. Examples of usage are an input that wants audio or an image.
setAllowDataType
是在输入字段中添加允许的类型。因此,如果用户想要添加 gif、img 等……他们可以。默认情况下,我不相信用户可以添加这些类型的项目。
关于android - RemoteInput 上的 AllowedDataType 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47722165/
有一个名为 setAllowDataType 的新函数在 RemoteInput.Builder 在 API 26 中。这是做什么用的?我尝试了以下方法: val remoteInput = Remo
我是一名优秀的程序员,十分优秀!