OH_ArkUI_RunTaskInScope

Function OH_ArkUI_RunTaskInScope 

Source
pub unsafe extern "C" fn OH_ArkUI_RunTaskInScope(
    uiContext: ArkUI_ContextHandle,
    userData: *mut c_void,
    callback: Option<unsafe extern "C" fn(userData: *mut c_void)>,
) -> i32
Available on crate features api-12 and api-20 only.
Expand description

Run a custom function inside the UIContext scope.

§Arguments

  • uiContext - ArkUI_ContextHandle.

  • userData - Indicates the pointer to the custom data.

  • callback - The custom function.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_CAPI_INIT_ERROR] if the CAPI init error. Returns [ARKUI_ERROR_CODE_UI_CONTEXT_INVALID] if the uiContext is invalid. Returns [ARKUI_ERROR_CODE_CALLBACK_INVALID] if the callback function is invalid.

Available since API-level: 20