[英]Programatically set meta-data content in android
Can we set the content of meta-data tag programmatically ie without using manifest.Here is a code snippet from manifest 我们是否可以通过编程方式设置元数据标签的内容,即不使用清单。这里是清单中的代码段
<application
android:allowBackup="true"
android:theme="@style/AppTheme"
>
<meta-data
android:name="com.samsung.android.vr.application.mode"
android:value="vr_only"/>
....... .......
No, sorry. 不,对不起
<meta-data>
elements are only set at compile time. <meta-data>
元素仅在编译时设置。
The particular library that you are using that requires the <meta-data>
element might offer some way to configure it via Java code, instead of the <meta-data>
element. 您正在使用的需要
<meta-data>
元素的特定库可能提供了一些通过Java代码而不是<meta-data>
元素进行配置的方法。 The details of this would vary by library. 具体细节因图书馆而异。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.