pub unsafe extern "C" fn OH_ArkUI_PostAsyncUITask(
context: ArkUI_ContextHandle,
asyncUITaskData: *mut c_void,
asyncUITask: Option<unsafe extern "C" fn(asyncUITaskData: *mut c_void)>,
onFinish: Option<unsafe extern "C" fn(asyncUITaskData: *mut c_void)>,
) -> i32Available on crate features
api-12 and api-22 only.Expand description
Post UI task to background threads.
§Arguments
-
context- UIContext pointer of the page where the UI task located. -
asyncUITaskData- Parameter of asyncUITask and onFinish. -
asyncUITask- Function executed by a background thread. -
onFinish- Function executed by UI thread after async UI task is executed.
§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 asyncUITask is nullptr.
Available since API-level: 22