Tuesday, 15 March 2011

android - How to recreate previous activity? -


I have a main activity (let's call it A) and another activity (let's call it B) The app's language issue is, when I click on the button to change the language, then I also recreate (); and B turns it into language even so it's okay. The problem comes when I go back to main activity (A) and have not updated the language because it has not been restarted, so is there any way to recreate A from A to update A?

I use this code to translate the app (Example Examples):

  Public Zero btnIngles_onClick (see V) {Locale Locale = New Locale "N"); Locale.setDefault (location); Configuration config = new configuration (); Config.locale = locale; This.getApplicationContext (). GetResources () Updateconfiguration (config, null); Re: (); }  

1) activity b changes some global settings Activity A in

2) accessible by shared references for example:

  @ Override safe at zero (again) {super. Rebirth (); If (changed language) rest (); }  

The problem is resolved. Activity A Resume (at call) Because it has turned into a stopped position when Activity B arrives in the foreground.


No comments:

Post a Comment