是否可以在深度链接 URI 中使用字符串常量?
目前我有几个链接,导致主机部分重复:
<deepLink app:uri="www.host.com/a" />
<deepLink app:uri="www.host.com/b" />
<deepLink app:uri="www.host.com/c" />
<deepLink app:uri="www.host.com/d" />
因此,我正在寻找一种以某种方式提取的方法www.host.com
。
我一直天真地尝试将其提取到strings.xml
:
<string name="host">www.host.com</string>
接着:
<deepLink app:uri="{@string/host}/details/{id}" />
但这不起作用(Improper use of wildcards and/or placeholders in deeplink URI host
编译错误)