我已将我的应用程序更新为新的Android App Bundle。我已经在内部测试轨道中上传了一个新的App Bundle。
现在,当我向手机添加新语言时,它不会像我们期望的那样为我的应用下载相关语言。
是否指定了何时下载新语言?
谢谢。
答案 0 :(得分:1)
首先,您需要在应用中添加播放核心依赖项。并遵循示例代码
请求语言模块
val manager = SplitInstallManagerFactory.create(this)
// Skip loading if the module already is installed. Perform success action directly.
if (manager.installedModules.contains(targetLocalName)) {
onSuccessfulLoad(targetLocalName)
return
}
val request = SplitInstallRequest.newBuilder()
.addModule(targetLocalName)
.build()
// Load and install the requested feature module.
manager.startInstall(request)
在您的应用程序和活动中拆分安装
override fun attachBaseContext(newBase: Context) {
val ctx = LanguageHelper.getLanguageConfigurationContext(newBase)
super.attachBaseContext(ctx)
SplitCompat.installActivity(this)
}
您应该参考doc和动态捆绑包演示 doc
答案 1 :(得分:1)
如果手机中没有该语言,则在下载该应用程序时,Google Play会从该应用程序中删除该语言,因为该电话未安装该语言。
如果只想显示应用程序的特定语言,则可以在build.gradle
文件中如下所示的参数中进行设置。
defaultConfig {
resConfigs "en", "ar", "fr"
}