typedef struct {...} ArkUI_ContextCallback Defines an event callback type, which is used to define the callback function and its user-defined data. When an API of this type is called to trigger a callback, the callback is invoked and userData is passed as a parameter.
Since: 12
Related module: ArkUI_NativeModule
Header file: native_type.h
| Name | Description |
|---|---|
| void* userData | Pointer to the user-defined data, which is passed as a parameter during callback. |
| Name | Description |
|---|---|
| void (*callback)(void* userData) | Pointer to the callback executed when an event is triggered. The user-defined data pointed to by userData is passed when the callback is invoked. |
void (*callback)(void* userData)
Description
Pointer to the callback executed when an event is triggered. This callback does not return any value. When the callback is triggered, the user-defined data pointed to by userData is passed as a parameter to execute the custom processing logic. The specific triggering time is defined by the API of this type.