Skip to main content

OH_ArkUI_PostUITask

Function OH_ArkUI_PostUITask 

Source
pub unsafe extern "C" fn OH_ArkUI_PostUITask(
    context: ArkUI_ContextHandle,
    taskData: *mut c_void,
    task: Option<unsafe extern "C" fn(taskData: *mut c_void)>,
) -> i32
Available on crate features api-12 and api-22 only.
Expand description

Post UI task to UI thread.

§Arguments

  • context - UIContext pointer of the page where the UI task located.

  • taskData - Parameter of task.

  • task - Function executed by UI thread.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if context or task is nullptr.

Available since API-level: 22