public static interface

MapUiApi.Lifecycle

com.mapsted.ui.MapUiApi.Lifecycle
Known Indirect Subclasses

Summary

Public Methods
abstract void onConfigurationChanged(AppCompatActivity activity, Configuration newConfig)
This method makes sure that the sdk properly loads the selected language when language is switched.
abstract void onDestroy()
Notify SDK of activity destroyed.
abstract void onPause()
Notify SDK of activity paused
abstract boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
abstract void onResume()
Notify SDK of activity resumed

Public Methods

public abstract void onConfigurationChanged (AppCompatActivity activity, Configuration newConfig)

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.

public abstract void onDestroy ()

Notify SDK of activity destroyed. The sdk will shutdown its services.

public abstract void onPause ()

Notify SDK of activity paused

public abstract boolean onRequestPermissionsResult (int requestCode, String[] permissions, int[] grantResults)

Parameters
requestCode forward this value from activity or fragment. Do not create this value.
permissions forward this value from activity or fragment. Do not create this value.
grantResults forward this value from activity or fragment. Do not create this value.
Returns
  • whether this permission was handled or not. If false, then the request belonged to someone else, you should call super. This boolean does not mean permission was granted or not. It only means whether this request was made by sdk component and was handled/processed (success or failure)

public abstract void onResume ()

Notify SDK of activity resumed