如何设置应用程序的语言环境?

编程入门 行业动态 更新时间:2024-10-28 11:27:04
本文介绍了如何设置应用程序的语言环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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>

更多推荐

如何设置应用程序的语言环境?

本文发布于:2023-11-14 02:03:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585926.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   如何设置   语言   环境

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!