public class

MapstedMapUiApi.LifecycleImpl

extends Object
implements MapUiApi.Lifecycle
java.lang.Object
   ↳ com.mapsted.ui.MapstedMapUiApi.LifecycleImpl

Summary

Public Constructors
LifecycleImpl(Context context)
Public Methods
void onConfigurationChanged(AppCompatActivity activity, Configuration newConfig)
This method makes sure that the sdk properly loads the selected language when language is switched.
void onDestroy()
Notify SDK of activity destroyed.
void onPause()
Notify SDK of activity paused
boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
void onResume()
Notify SDK of activity resumed
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.mapsted.ui.MapUiApi.Lifecycle

Public Constructors

public LifecycleImpl (Context context)

Public Methods

public 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 void onDestroy ()

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

public void onPause ()

Notify SDK of activity paused

public 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 void onResume ()

Notify SDK of activity resumed