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中的一些静态方法.如 ...
随机推荐
- __cxa_call_unexpected原因
coredump的调用栈: #0 0xf76f5440 in __kernel_vsyscall () #1 0xf73c4657 in raise () from /lib/libc.so.6 ...
- django基础操作
web应用程序:可以通过web访问的应用程序 bs/cs架构 http协议 基于TCP/IP协议之上的应用层协议 基于请求-响应模式:客户端先发送请求,服务端再响应 无状态保存:http协议对于发送的 ...
- Ubuntu Remove Mysql.service in Systemctl
After installing MySQL 5.7, I do not want to start MySQL via systemctl. It's unconvenient and compli ...
- EL表达式总结
EL表达式是在JSP中使用的 EL表达式的作用:简化jsp文件中的<% %>. [EL的概述] 什么是EL: 为什么学习EL: * 简化JSP的代码,而且减少<%%> 使用EL ...
- ScheduledExecutorService的使用
http://407827531.iteye.com/blog/1329597 ScheduledExecutorService接口 在ExecutorService的基础上,ScheduledExe ...
- Idea使用拆解
收藏学习地址 https://blog.csdn.net/qq_28804275/article/details/80891907
- excel查找某一列的值在、不在另一列中
统计中遇到找出一列的值不在另一列的需求: 找出A列中不在B列的值 方法如下: 使用countif函数 比如找出A列中不在B列的值: 在C1中输入 COUNTIF(B:B,A1) 下拉单元格,在首行添加 ...
- Django 数据生命周期
- 由异常掉电问题---谈xfs文件系统
由异常掉电问题---谈xfs文件系统 本文皆是作者自己的学习总结或感悟(linux环境),如有不对,欢迎提出一起探讨!! 目录结构 一.相关知识 二.问题提出 三.处理方法 四.最终结果 一.相关知识 ...
- 4.动态HTML处理和机器图像识别
Selenium Selenium是一个Web的自动化测试工具,最初是为网站自动化测试而开发的,类型像我们玩游戏用的按键精灵,可以按指定的命令自动操作,不同是Selenium 可以直接运行在浏览器上, ...