Change phone language programmatically?

IamBot

Member
Licensed User
Longtime User
Hi,

Is it possible to change the language of the phone programmatically?

I need code that can change from current language to English (UK) and later change back to the previous chosen language. It would be great if no menu would pop up so that the user has to manually select or confirm the change.

Would appreciate some help, thx!
 

ukimiku

Active Member
Licensed User
Longtime User
What do you mean by "language of the phone"? Do you want to set the system default language in code?

If you only wanted to change the language of your app temporarily, you could do that by including language-specific resource folders and files (which I find cumbersome), or just have your app access a set of appropriate messages according to the desired language. I often store messages in several languages in a map, which is filled depending on the system default language of the phone (queried at startup, but you could change that at any time).

If you want to change the system default language, I don't know how that could work.

Regards,
 
Upvote 0

IamBot

Member
Licensed User
Longtime User
Hi,

Yes I meant the system default language.

But I've already found a way around this problem so my app is now working :)
 
Upvote 0
Top