android - locale notification, need to dump cache

99封情书 提交于 2019-12-25 00:19:26

问题


We are localizing our app to be able to easily switch between languages. Everything works nicely except for some cached values that are actually in navigation. We have two options:

  1. completely restart app on language change - in this case I need a notification and force restart

  2. just load new strings into the table - in this case it will require to replace string values and rbuild custom navigation state.

IN both cases we need a way to find out when language switches. Is there an intent we can listen to? If yes could you please advise on which one? I am thinking to go with a broadcast receiver. I am just not sure which intent action it is. In below example what is the SOME_ACTION value?

Thanks in advance.

 <receiver android:name="com.v1.application.notifications.LanguageChangeReceiver">
            <intent-filter>
                <action android:name="android.intent.action.SOME_ACTION" />
            </intent-filter>
        </receiver>

回答1:


android.intent.action.CONFIGURATION_CHANGED



来源:https://stackoverflow.com/questions/9776313/android-locale-notification-need-to-dump-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!