代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
StartOptions is used as an input parameter of startAbility() to specify the window mode of an ability.
NOTE
The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. The APIs of this module can be used only in the stage model.
import StartOptions from '@ohos.app.ability.StartOptions';
System capability: SystemCapability.Ability.AbilityRuntime.Core
Name | Type | Mandatory | Description |
---|---|---|---|
windowMode | number | No | Window mode. System API: This is a system API and cannot be called by third-party applications. |
displayId | number | No | Display ID mode. The default value is 0, indicating the current display. |
withAnimation11+ | boolean | No | Whether the ability has the animation effect. |
windowLeft11+ | number | No | Left position of the window. |
windowTop11+ | number | No | Top position of the window. |
windowWidth11+ | number | No | Width of the window. |
windowHeight11+ | number | No | Height of the window. |
Example
import UIAbility from '@ohos.app.ability.UIAbility';
import Want from '@ohos.app.ability.Want';
import StartOptions from '@ohos.app.ability.StartOptions';
import { BusinessError } from '@ohos.base';
export default class EntryAbility extends UIAbility {
onForeground() {
let want: Want = {
deviceId: '',
bundleName: 'com.example.myapplication',
abilityName: 'EntryAbility'
};
let options: StartOptions = {
windowMode: 0
};
try {
this.context.startAbility(want, options, (err: BusinessError) => {
if (err.code) {
// Process service logic errors.
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`);
return;
}
// Carry out normal service processing.
console.info('startAbility succeed');
});
} catch (err) {
// Process input parameter errors.
let code = (err as BusinessError).code;
let message = (err as BusinessError).message;
console.error(`startAbility failed, code is ${code}, message is ${message}`);
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。