Android get current Locale, not default
he default Locale
is constructed statically at runtime for your application process from the system property settings, so it will represent the Locale
selected on that device when the application was launched. Typically, this is fine, but it does mean that if the user changes their Locale
in settings after your application process is running, the value of getDefaultLocale()
probably will not be immediately updated.
If you need to trap events like this for some reason in your application, you might instead try obtaining the Locale
available from the resource Configuration
object, i.e.
Locale current = getResources().getConfiguration().locale;
You may find that this value is updated more quickly after a settings change if that is necessary for your application.
http://stackoverflow.com/questions/14389349/android-get-current-locale-not-default
Android get current Locale, not default的更多相关文章
- Android修改Eclipse 中的Default debug keystore路径,以及修改android的AVD默认路径
初学android,光是配置Eclipse就走了不少弯路,班里面有很多同学的计算 机名都是写的自己的中文姓名,结果导致了AVD文件默认保存在“C:\user\<username>\.and ...
- android的Project has no default.properties file! Edit the project properties to set one. 的解决
网上找来这种方法基本解决: 在我们导入Android工程时,有时候会出现如题所述的错误,打开工程目录可以看到,目录下的default.properties文件没有了或者多出了一个project.pro ...
- Android Studio打开出现:Default activity not found
昨天项目可以正常打开,没有问题,今天打开的时候就出现了这个问题.可以编译,但是无法生成APK调试.当然,如果选择 Do not launch Activity就可以成功编译.出现这个 Default ...
- Android默认输入法语言的修改以及SettingsProvider作用
Android源码中默认的有三种输入法:英文,中文,日文.对应的工程代码路径为:<android_root>/packages/inputmethods/LatinIME/<andr ...
- mono环境变量
mono环境变量 2013-05-11 01:14:33| 分类: mono|举报|字号 订阅 下载LOFTER我的照片书 | Name mono - Mono's ECMA-CL ...
- Android Lint Checks
Android Lint Checks Here are the current list of checks that lint performs as of Android Studio 2.3 ...
- Android应用如何支持屏幕多尺寸多分辨率问题
作为Android应用程序开发者都知道android是一个“碎片化”的世界.多种系统版本.多种尺寸.多种分辨率.多种机型,还有不同的厂商定制的不同ROM,你开发的应用会在不可预期的手机上报错.这给开发 ...
- 支持不同Android设备,包括:不同尺寸屏幕、不同屏幕密度、不同系统设置
Some of the important variations that you should consider include different languages, screen sizes, ...
- android打开存储卡(TF卡\SD卡)中的sqlite文件
android的SDK直接支持sqlite3的API. 打开SD卡上面的sqlite数据库,不需要SQLiteOpenHelper的继承类.只需要,SQLiteDatabase中的一些静态方法.如 ...
随机推荐
- curl工具介绍和常用命令
curl是利用URL语法在命令行方式下工作的开源文件传输工具.它被广泛应用在Unix.Linux发行版中,并且有DOS和Win32.Win64的移植版本.curl是一个利用URL规则在命令行下工作的文 ...
- SRM477
250pt: 题意:给定一块蜂巢状的N*M矩阵,每块六边形和周围6个六边形相邻,现在告诉你哪些是陆地,哪些是水,问水陆交界处的长度. 思路:直接模拟 code: #line 7 "Islan ...
- Android中去掉标题栏
在Android中去掉标题栏有三种方法,它们也有各自的特点. 1.在代码里实现 this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏 记 ...
- ASP.NET Web API 框架研究 服务容器 ServicesContainer
ServicesContainer是一个服务的容器,可以理解为—个轻量级的IoC容器,其维护着一个服务接口类型与服务实例之间的映射关系,可以根据服务接口类型获取对应的服务实例.构成ASP.NET We ...
- expect 安装使用
expect 命令相当于crt远程连接,可用于脚本化实现多服务器巡检功能. 一.expect 命令安装: 1.rpm 文件下载:百度云链接:http://pan.baidu.com/s/1sl1wSU ...
- [HTML5]如何使用移动设备的方向定位器
HTML5 Rocks Show navigation Table of Contents Home Tutorials Updates Table of Contents Introduction ...
- poj 1837 01背包
Balance Time Limit: 1000 MS Memory Limit: 30000 KB 64-bit integer IO format: %I64d , %I64u Java clas ...
- poj 3264 区间最大最小值 RMQ问题之Sparse_Table算法
Balanced Lineup Time Limit: 5000 MS Memory Limit: 0 KB 64-bit integer IO format: %I64d , %I64u Java ...
- phpize增加php模块
phpize增加php模块 张映 发表于 2010-02-09 分类目录: php 一,phpize的好处 什么时候我们要用phpize呢?我们在安装php时: './configure' '--pr ...
- [Proposal]Tank Battle——Infinite
Tank Battle——Infinite 把经典的坦克大战扩展到一个“无限”大的2D地图上.支持“全世界”的玩家同时在线玩. 游戏模式当然要做成全新的.增加玩家之间的交互,但又不较强的依赖于实时的通 ...