AndroidRegisterLifecycleListener |
Type | handler |
Dictionary | library.androidutils |
Library | Android Utilities |
Syntax | AndroidRegisterLifecycleListener(<pPauseHandler>,<pResumeHandler>)
|
Associations | com.livecode.library.androidutils |
Summary | Register handlers to be called when on application lifecycle events.
|
OS | android |
Parameters | Name | Type | Description |
---|
pPauseHandler | | The handler to be called when the application is paused
|
pResumeHandler | | The handler to be called when the application is resumed
|
|
Example | private variable mLifecycleListener as optional JObject
public handler OnOpen() returns nothing
put AndroidRegisterLifecycleListener(OnMyWidgetPaused, OnMyWidgetResumed) into mLifecycleListener
end handler
public handler OnClose() returns nothing
AndroidUnregisterLifecycleListener(mLifecycleListener)
put nothing into mLifecycleListener
end handler
private handler OnMyWidgetPaused() returns nothing
end handler
private handler OnMyWidgetResumed() returns nothing
end handler
|
Values | Name | Type | Description |
---|
return | | A listener object that wraps the registered handlers.
|
|
Description | Use the AndroidRegisterLifecycleListener handler to register handlers to
application lifecycle events. The handler pPauseHandler will be called when
the application is paused and enters into the background. The handler
pResumeHandler will be called when the application is resumed and returns from
the background.
A listener object will be returned that wraps the registered handlers and can be
used with AndroidUnregisterLifecycleListener to cancel the registration.
|