harmony 鸿蒙featureAbility接口切换

  • 2022-12-13
  • 浏览 (548)

featureAbility接口切换

FA模型接口 Stage模型接口对应d.ts文件 Stage模型对应接口
getWant(callback: AsyncCallback<Want>): void;
getWant(): Promise<Want>;
\@ohos.app.ability.UIAbility.d.ts launchWant: Want;
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void;
startAbility(parameter: StartAbilityParameter): Promise<number>;
application\UIAbilityContext.d.ts startAbility(want: Want, callback: AsyncCallback<void>): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void;
startAbility(want: Want, options?: StartOptions): Promise<void>;
getContext(): Context; \@ohos.app.ability.UIAbility.d.ts context: UIAbilityContext;
startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void;
startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>;
application\UIAbilityContext.d.ts startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void;
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void;
startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>;
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
application\UIAbilityContext.d.ts terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
terminateSelf(callback: AsyncCallback<void>): void;
terminateSelf(): Promise<void>;
application\UIAbilityContext.d.ts terminateSelf(callback: AsyncCallback<void>): void;
terminateSelf(): Promise<void>;
acquireDataAbilityHelper(uri: string): DataAbilityHelper; \@ohos.data.dataShare.d.ts
\@ohos.data.fileAccess.d.ts
createDataShareHelper(context: Context, uri: string, callback: AsyncCallback<DataShareHelper>): void;
createDataShareHelper(context: Context, uri: string): Promise<DataShareHelper>;
createFileAccessHelper(context: Context): FileAccessHelper;
createFileAccessHelper(context: Context, wants: Array<Want>): FileAccessHelper;
hasWindowFocus(callback: AsyncCallback<boolean>): void;
hasWindowFocus(): Promise<boolean>;
\@ohos.window.d.ts on(eventType: ‘windowStageEvent’, callback: Callback<WindowStageEventType>): void;
监听Active获焦状态
connectAbility(request: Want, options:ConnectOptions ): number; application\UIAbilityContext.d.ts connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
disconnectAbility(connection: number): Promise<void>;
application\UIAbilityContext.d.ts disconnectAbility(connection: number, callback:AsyncCallback<void>): void;
disconnectAbility(connection: number): Promise<void>;
getWindow(callback: AsyncCallback<window.Window>): void;
getWindow(): Promise<window.Window>;
\@ohos.window.d.ts getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void;
getLastWindow(ctx: BaseContext): Promise<Window>;

你可能感兴趣的鸿蒙文章

harmony 鸿蒙应用模型

harmony 鸿蒙使用显式Want启动应用组件

harmony 鸿蒙使用隐式Want打开网址

harmony 鸿蒙AbilityStage组件容器

harmony 鸿蒙访问DataAbility

harmony 鸿蒙FA模型访问Stage模型DataShareExtensionAbility

harmony 鸿蒙AccessibilityExtensionAbility

harmony 鸿蒙常见action与entities

harmony 鸿蒙API切换概述

harmony 鸿蒙app和deviceConfig的切换

0  赞