onConfigurationChanged

This method makes sure that the sdk properly loads the selected language when language is switched. Your activity will be closed like default android behavior. In the subsequent app launch, the Mapsted sdk will properly load with the new language setting.

You don't need to call this method if your activity extends com.mapsted.apptemplate.ui.main.MapstedAppTemplateMainActivity. Just make sure your manifest's main activity has following onConfig attribute


<activity android:configChanges="locale|layoutDirection"
 ...
/>

If you implemented onConfigurationChanged method in your main activity which extends MapstedAppTemplateMainActivity, then call super.onConfigurationChanged(newConfig). If you did not implement onConfigurationChanged method in your main activity, there is no need to call the super, since it will called by default.

If your main activity does not extend MapstedAppTemplateMainActivity, then make the manifest entry like above for your main activity and call this method in your main activity's onConfigurationChanged like so.


//MainActivity
@Override
public void onConfigurationChanged(Configuration newConfig) {
   super.onConfigurationChanged(newConfig);
   mapUiApi.onConfigurationChanged(this, newConfig);
}

Parameters

activity

your main activity

newConfig

pass in the newConfig you received from activity's onConfigurationChanged callback.