public static interface AbilitySlice.FormCallback
Form instance is obtained or when the Form
provider is uninstalled.
This interface must be implemented to listen for the Form acquisition result and uninstallation event
of the form provider if your application needs to call AbilitySlice.acquireForm(ohos.aafwk.content.Intent,ohos.aafwk.ability.AbilitySlice.FormCallback) to
obtain a Form instance.
SystemCapability.Aafwk#ABILITY| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
OHOS_FORM_ACQUIRE_SUCCESS |
Indicates that the
Form is obtained successfully. |
static int |
OHOS_FORM_APPLY_FAILURE |
Indicates that the system failed to draw the form layout.
|
static int |
OHOS_FORM_PREVIEW_FAILURE |
Indicates that the system failed to generate the form preview.
|
static int |
OHOS_FORM_REAPPLY_FAILURE |
Indicates that the system failed to update the form layout.
|
static int |
OHOS_FORM_RESTORE_FAILURE |
Indicates that the system failed to restore the form.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onAcquired(int result,
Form form) |
Called to notify the application that the
Form instance has been obtained after
the application called
the asynchronous method AbilitySlice.acquireForm(ohos.aafwk.content.Intent,ohos.aafwk.ability.AbilitySlice.FormCallback). |
default void |
onAcquiredState(Intent intent,
FormState formState) |
Called to notify the application that the
FormState has been obtained by calling
{@link ohos.aafwk.ability.AbilitySlice#acquireFormState(Intent, FormCallback AbilitySlice#acquireFormState(Intent, FormCallback} |
void |
onFormUninstalled(int formId) |
已过时。
This change is effective since API version 5. Replaced by
onFormUninstalled(long). |
default void |
onFormUninstalled(long formId) |
Called to notify the application that the
Form provider has been uninstalled and the corresponding
Form instance is no longer available. |
static final int OHOS_FORM_ACQUIRE_SUCCESS
Form is obtained successfully.static final int OHOS_FORM_APPLY_FAILURE
static final int OHOS_FORM_PREVIEW_FAILURE
static final int OHOS_FORM_REAPPLY_FAILURE
static final int OHOS_FORM_RESTORE_FAILURE
void onAcquired(int result,
Form form)
Form instance has been obtained after
the application called
the asynchronous method AbilitySlice.acquireForm(ohos.aafwk.content.Intent,ohos.aafwk.ability.AbilitySlice.FormCallback).
The application must present
the form information on a specific page in this callback.result - Specifies whether the asynchronous form acquisition process is successful.
FormCallback#OHOS_FORM_ACQUIRE_SUCCESS indicates that the form is successfully obtained,
and other values indicate that the process fails.form - Indicates the obtained Form instance.@Deprecated void onFormUninstalled(int formId)
onFormUninstalled(long).Form provider has been uninstalled and the corresponding
Form instance is no longer available. Compatible with int form id.formId - Indicates the ID of the Form instance provided by the uninstalled form provider.default void onFormUninstalled(long formId)
Form provider has been uninstalled and the corresponding
Form instance is no longer available.formId - Indicates the ID of the Form instance provided by the uninstalled form provider.