hi,

thanks for this.

I've found the same sourcecode here:
http://almondmendoza.com/2009/01/28/force-localize-an-application-on-android/

:)

All I had to add was this: this.setContentView(R.layout.main);

This way my layout is updated with the right language.

Thought there might be an update mechanism except loading the xml again....


Greetings,
DaRolla

2009/4/23 Evgeny V <evgen...@gmail.com>:
> Hi!
> Try this.
>
> I have res\values and res\values-ja-rJP folders.
> Using following code:
>
>         String languageToLoad  = "jp";
>
>         Locale locale = new Locale(languageToLoad);
>         Locale.setDefault(locale);
>         Configuration config = new Configuration();
>         config.locale = locale;
>         context.getBaseContext().getResources().updateConfiguration(config,
>         context.getBaseContext().getResources().getDisplayMetrics());
>
>
>
> On Thu, Apr 23, 2009 at 11:43 AM, DaRolla <netzprofi.ma...@googlemail.com>
> wrote:
>>
>> hello,
>>
>> I need to change the language of a running apk on demand.
>>
>> So the texts are set in xml to @strings/name
>>
>> And there are different strings.xml inside values-de values-en values-
>> tr and so on.
>>
>> Is there a way to tell android to update the layout in order to change
>> the strings automatically?
>>
>> Or do I have to replace all of them by hand using findById().setText
>> (R.strings.name) ?
>>
>> Greetings
>> DaRolla >>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to