zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Basic GC Tuning
    程序员如何少走弯路,更好的提升技术。
    WPF 多线程
    IOC
    一句话概括WPF知识点
    WPF数据绑定 Binding
    WPF命令
    WPF依赖属性
    WPF路由事件
    WPF绘图和动画
  • 原文地址:https://www.cnblogs.com/savagemorgan/p/4202746.html
Copyright © 2011-2022 走看看