Changing locale: Force activity to reload resources?

后端 未结 6 1490
感情败类
感情败类 2020-11-30 06:24

So I have a language setting in my application. When the language is switched, I would like all the textviews etc to change language immediately. Currently I just change the

6条回答
  •  借酒劲吻你
    2020-11-30 07:15

    I'm not sure why this isn't picked up by onConfigurationChanged().

    Hey, sandis, do you mean the method onConfigurationChanged() doesn't called in your activity when you changed the language? I met the same problem. The problem maybe this: when we change the language, the activity goes to onDestroy()(you can try this), so there is nobody to call onConfigurationChanged(). When we launch the activity again, the onCreate() is called, not the onConfigurationChanged(). There maybe something different in locale change and orientation change.

提交回复
热议问题