I figured a way to reload the activities. simply call this.onCreate
(null); to reload the current activity.

For example if you have a hierarchy like me: MainActivity ->
PreferenceActivity and make a change in preferences, i listen for a
change and with onSharedPreferenceChanged and call this.onCreate
(null). When we go back, we need to reload the MainActivity, onResume
() will be called so we put this.onCreate(null) there too and that
should be enough.

It works for my solution for changing the locale for the application.

Hope it helps!

// Ronald

On Jul 19, 1:24 pm, Anders Aagaard <aagaa...@gmail.com> wrote:
> Hi
>
> I have an application, where I need to change the language through a
> settings menu.  Now this part works perfectly, but it doesn't change
> the language for activities that have gone through onCreate.
>
> I got a TabHost, and 2 tabs in it, from the tabs you can get to
> settings.
>
> Refreshing the TabHost isn't an issue, as it's fairly small, however
> both the 2 tabs are quite large views, and having a function to
> manually update all the strings seem unnecessarily difficult.  Is
> there any way to force theactivityto recreate itself and trigger a
> new onCreate?
>
> I tried having a static function in the tabhost that clears all tabs
> and recreates them, this refreshes the tab titles, but not the content
> in the tabs.
>
> Anders Aagaard
--~--~---------~--~----~------------~-------~--~----~
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