我从“设置”应用程序中获得此代码...
<string name="about_settings" product="tablet">About tablet</string>
<string name="about_settings" product="default">About phone</string>
那么我的问题是:
- 系统在运行时从哪里加载正确的字符串资源?
要添加新产品我必须做什么?例如
<string name="about_settings" product="laptop">About laptop</string>
最佳答案
- 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/