如何设置应用程序的语言环境? [英] how to set application locale?
问题描述
我有一个Android应用程序中,我需要在整个应用程序的语言环境设置为德语。我不想进入每个活性的研究....当splashactivity /欢迎屏幕来了,我想的区域设置为我的应用程序的所有活动进行设置。我怎么去呢?
i have an android application in which i need to set the whole application locale to german. i don't want to go into each and every acitivity....when the splashactivity/ welcome screen comes, i want the locale to be set for all the activities in my application. how do i go about this?
来总结我的问题:如何设置Android应用程序(不活动)的语言环境。
预先感谢您。
to summarize my question: how to set the locale of the android application(not an activity). thank you in advance.
推荐答案
好你要扩展应用程序类,并创建一个子类
well you have to extends Application class and create a subclass from that
public class MyApp extends Application{
onCreate(){
//set you locale
}
和可以提到它在你的menifest文件中像
and you can mention it in your menifest file like
<application name="MyApp">
.....
</application>
这篇关于如何设置应用程序的语言环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!