Reputation:
When i select a language in portrait mode, it works fine. when i change orientation to landscape and back to portrait mode by default language English gets selected.
I tried this code in android menifest file
android:configChanges="keyboard|Hidden|screenSize|orientation
So can any one suggest me how to achieve the above requirement? Thanx in advance
Upvotes: 1
Views: 1005
Reputation: 6499
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Set your locale here...
}
in your activity class add above code, when rotation is changed above method is called and locale not remember what you locale set on portrait locale.
Upvotes: 2
Reputation: 527
Right way is to handle it from your application Object.
public class MyApp extends Application {
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Set your locale here...
}
}
Upvotes: -1