Btw, how about just startActivity(getIntent()); finish(); ? On Thu, Aug 6, 2009 at 10:57 AM, Dianne Hackborn <hack...@android.com>wrote:
> You are just lucky that this happens to work, and there are many things you > can do in your activity that will utterly break if you do this. > > > On Wed, Aug 5, 2009 at 11:54 PM, Ronald Pompa <ronald.po...@gmail.com>wrote: > >> >> 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 >> >> >> > > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---