android - 如何更改“功能”以从 OPEN_FEATURE 的应用操作中打开?
问题描述
这是我拥有的 actions.xml:
<actions>
<action intentName="actions.intent.GET_ACCOUNT">
<parameter name="account.name">
<entity-set-reference entitySetId="AccountEntitySet" />
</parameter>
<fulfillment urlTemplate="https://www.xelion.com/account{?accountType}">
<parameter-mapping
intentParameter="account.name"
urlParameter="accountType" />
</fulfillment>
</action>
<action intentName="actions.intent.OPEN_APP_FEATURE">
<parameter name="feature">
<entity-set-reference entitySetId="FeatureEntitySet" />
</parameter>
<fulfillment urlTemplate="https://www.xelion.com/open{?featureName}">
<parameter-mapping
entityMatchRequired="true"
intentParameter="feature"
urlParameter="featureName" />
</fulfillment>
</action>
<entity-set entitySetId="EntitySet">
<!-- For each entity you can specify the name, alternate names and the identifier -->
<!-- The identifier is the value that will be added to the action uri. -->
<!-- For our sample we map the supported entities with the class FitActivity.Type -->
<entity
name="start"
identifier="START" />
<entity
name="stop"
identifier="STOP" />
</entity-set>
<entity-set entitySetId="FeatureEntitySet">
<entity
name="call"
alternateName="@array/callSynopsis"
identifier="CALL" />
<entity
name="history"
identifier="HISTORY" />
</entity-set>
<entity-set entitySetId="AccountEntitySet">
<entity
name="utility"
identifier="UTILITY" />
<entity
name="sales"
identifier="SALES" />
</entity-set>
</actions>
现在,如果我尝试:“获取 Dialer Xelion 帐户”,这将触发 GET_ACCOUNT 。
如果我尝试“在 Dialer Xelion 上打开历史记录”它也会识别该功能并打开应用程序。
但它不适用于:“Open Call on Dialer Xelion” 如您所见,我在 FeatureEntitySet 中有它,那么可能是什么问题?
同样在 App Actions Test Tool v3.0.0 中,如果我选择 OPEN_APP_FEATURE 它只显示:“历史”我可以修改它,但如果我更新它会保持不变。请帮忙
我还为 getAccount 添加了一个 AccountEntitySet,但这也没有显示。我究竟做错了什么?
解决方案
现在应该解决这个问题。此外,包含的 JSON 只是一个示例,不打算使用您的任何自定义值进行更新。
继续解决此问题的一些建议:
- 在三个地方验证 SLICE_AUTHORITY确保 SliceProvider 扩展类中的 SLICE_AUTHORITY 与
android:authorities
AndroidManifest.xml 文件和 actions.xml 声明中的匹配。 - 尝试新鲜样品。如果这些步骤都不起作用。尝试Fitness Android 示例并向后工作以比较和识别您的应用程序中的差距。
如果 SLICE_AUTHORITY(#2) 最终成为这里的问题,请告诉我。
推荐阅读
- python - 在python中对列表的n个随机排列进行采样
- java - 如何在数据库spring boot,Jpa Repository中更新登录的用户详细信息
- c++11 - 可变参数函数模板参数匹配
- sql - 找出过去 10 年收入最高的人
- redhat - 我们怎么能在两个不同版本的 nuxeo 上拥有相同的文件?
- php - 自我终止如何在laravel 8中使用模态打开每个帖子
- python - input_file_name() 在处理镶木地板和具有多个分区的表时返回空字符串
- jquery - 如何使用ajax将变量从jquery发送到php文件
- python - 在 Jupyter Notebook 中显示导入类的日志记录
- android - 如何在 Recycler 视图中添加多个倒数计时器?