Jas*_*son 10 notifications android android-notifications remote-input
有一个所谓的新功能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()
Run Code Online (Sandbox Code Playgroud)
这应该设置isDataOnly到true的RemoteInput,但通知出现为手机上的以下.单击Image按钮不会执行任何操作.这个是来做什么的?我找不到有关此功能的任何文档,发行说明或教程.

实际发布通知时,看起来通知中缺少仅数据类型.查看构建器代码,在添加Actions到通知时,它使用级别24完全去除数据类型:https://android.googlesource.com/platform/frameworks/support/+/oreo-release/compat/api26/安卓/支持/ V4 /应用/ NotificationCompatApi26.java#108
原始问题仍然存在.
| 归档时间: |
|
| 查看次数: |
237 次 |
| 最近记录: |