java.lang.Object | |
↳ | com.mapsted.ui.MapstedMapUiApi.LifecycleImpl |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LifecycleImpl(Context context) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
onBackPressed()
Call whenever the back button is pressed
| ||||||||||
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Call whenever the back button is pressed
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);
}
activity | your main activity |
---|---|
newConfig | pass in the newConfig you received from activity's onConfigurationChanged callback. |
Notify SDK of activity destroyed. The sdk will shutdown its services.
Notify SDK of activity paused
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. |
Notify SDK of activity resumed