gpt4 book ai didi

android - 如何在语言环境更改时销毁应用程序

转载 作者:行者123 更新时间:2023-11-29 01:13:42 34 4
gpt4 key购买 nike

在我的多语言应用程序中,我想从启动器 Activity 中重新启动我的应用程序。但我无法这样做。我通过删除

更改了应用程序 list

locale

来自

android:configChanges="orientation|keyboardHidden"

但它对我不起作用。 list :

 <application
android:name=".Global.MyApp"
android:allowBackup="true"
android:icon="@drawable/login_meter"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
.....
.....
<activity
android:name=".SplashActivity"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme"
>
<intent-filter>
....

</intent-filter>
</activity>

....
....

</application>

最佳答案

有一个Intent 对于 Locale 更改操作。你应该注册 BroadcastReceiver 来捕获这个 Intent 并在 onReceive() 方法中做任何你想做的事情。

关于android - 如何在语言环境更改时销毁应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41261445/

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