F
F
falstaf2011-10-19 05:38:03
Java
falstaf, 2011-10-19 05:38:03

Android, change app localization on the fly

Good afternoon.

There is an android application with localization support and the ability to change it through the corresponding item in the application settings. Everything is fine, everything works, however, the new localization is applied only the next time the activity is created, or when the application is restarted.

Is it possible to somehow implement the change of application localization in runtime, i.e. so that after selecting the desired interface language in the settings, the changes will immediately be applied and reflected on the settings window itself?

Thank you in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
palmut, 2011-10-19
@palmut

In any case, you will have to restart the activity so that the new resources are loaded, and you can do it like this:

protected void restart() {
  Intent intent = getIntent();
  finish();

  startActivity(intent);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question