4

i have an android application in which i need to set the whole application locale to german. i don't want to go into each and every acitivity....when the splashactivity/ welcome screen comes, i want the locale to be set for all the activities in my application. how do i go about this?

to summarize my question: how to set the locale of the android application(not an activity). thank you in advance.

user590849
  • 11,655
  • 27
  • 84
  • 125
  • This should help http://stackoverflow.com/questions/4985805/set-locale-programatically – denis.solonenko Apr 19 '11 at 07:06
  • no , this does not help. i need to set the locale of the whole application. here what they are suggesting is that i write the code snippet they have given in the onResume method of all activities. – user590849 Apr 19 '11 at 07:07
  • 2
    Actually the code changes locale for all app, not only for calling activity, but you might have to restart the app for the changes to apply. – denis.solonenko Apr 19 '11 at 07:13

1 Answers1

4

well you have to extends Application class and create a subclass from that

public class MyApp extends Application{

onCreate(){
//set you locale
}

and you can mention it in your menifest file like

<application name="MyApp">

.....
</application>
Sunil Pandey
  • 7,042
  • 7
  • 35
  • 48
  • Have you tried this? I thought this was the obvious solution as well, but it doesn't really seem to work. – DuneCat Dec 09 '11 at 14:07