在我的多语言应用程序中,我想从启动器 Activity 中重新启动我的应用程序。但我无法这样做。我通过删除
更改了应用程序 listlocale
来自
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/