gpt4 book ai didi

android - 是否可以在 AndroidManifest.xml 标签中有自定义属性?

转载 作者:IT老高 更新时间:2023-10-28 21:50:48 31 4
gpt4 key购买 nike

我想在我的 AndroidManifest.xml 文件的应用程序标签中添加一个自定义属性。这在 Android 环境中可行吗?

最佳答案

是的。这是一个例子。自定义标签是 ContentVersion

<application android:name=".MyApplication"
android:icon="@drawable/icon"
android:label="@string/app_name">

<meta-data android:name="ContentVersion" android:value="1.9" />

<activity android:name="com.someone.something.MainActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:screenOrientation="sensor"
android:label="@string/app_name">

访问它:

    ApplicationInfo ai = _context.getPackageManager().getApplicationInfo(_context.getPackageName(),PackageManager.GET_META_DATA);
ai.metaData.get("ContentVersion")

关于android - 是否可以在 AndroidManifest.xml 标签中有自定义属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10311890/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com