本文介绍了android manifestPlaceholders - 如何使用布尔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建的清单占位符如下所示:
manifestPlaceholders = [appDrawerName: "Staging",canExport:"true"]
我正在尝试使用它来设置活动的以下导出属性:
关于如何解决这个问题的任何想法?我尝试使用 canExport:true 不带引号但结果相同.顺便说一句,第一个占位符工作正常.
解决方案 您必须提供一个布尔值而不是 manifestPlaceholders 数组中的字符串.
改变这个
manifestPlaceholders = [appDrawerName: "Staging",canExport:"true"]
到
manifestPlaceholders = [appDrawerName: "Staging",canExport:true]
注意布尔值 true 而不是字符串true"
Manifest placeholder i have created looks like this:
manifestPlaceholders = [appDrawerName: "Staging",canExport:"true"]
and i am trying to use it to set the following exported property on an activity:
<activity android:name=".UI.product.ProductDetailsHostActivity"
android:theme="@style/NoActionBarTheme"
android:exported="${canExport}"/>
But i get the following error:
any ideas on how i can resolve this ? i tried using canExport:true without the quotes but same results.
btw, the first placeholder works fine.
解决方案 You have to supply a boolean value instead of the string in manifestPlaceholders array.
change this
manifestPlaceholders = [appDrawerName: "Staging",canExport:"true"]
to
manifestPlaceholders = [appDrawerName: "Staging",canExport:true]
notice the boolean true instead of string "true"
这篇关于android manifestPlaceholders - 如何使用布尔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!