gpt4 book ai didi

特定产品的 Android 资源

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:07:01 26 4
gpt4 key购买 nike

我从“设置”应用程序中获得此代码...

<string name="about_settings" product="tablet">About tablet</string>
<string name="about_settings" product="default">About phone</string>

那么我的问题是:

  1. 系统在运行时从哪里加载正确的字符串资源?
  2. 要添加新产品我必须做什么?例如

    <string name="about_settings" product="laptop">About laptop</string>

最佳答案

  1. from where at runtime the system load the correct string resource ?

系统不会在运行时加载它。根据为特定目标构建定义的 PRODUCT_CHARACTERISTICS 预加载正确的字符串资源。所以你不能在从 Eclipse 构建时使用它。这仅用于构建平台上预加载的应用。

2 . What must I do to add a new product? e.g.

您需要在 device.mk 文件中添加到 PRODUCT_CHARACTERISTICS

关于特定产品的 Android 资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16995503/

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