Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8cb9e6bd
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
You need to sign in or sign up before continuing.
提交
8cb9e6bd
编写于
5月 18, 2023
作者:
Y
yuyaozhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix release docs error of ability
Signed-off-by:
N
yuyaozhi
<
yuyaozhi@huawei.com
>
上级
618ff2df
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
283 addition
and
333 deletion
+283
-333
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md
...ence/apis/js-apis-app-ability-abilityDelegatorRegistry.md
+0
-4
zh-cn/application-dev/reference/apis/js-apis-app-ability-missionManager.md
...-dev/reference/apis/js-apis-app-ability-missionManager.md
+278
-311
zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityHelper.md
...reference/apis/js-apis-inner-ability-dataAbilityHelper.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-inner-app-context.md
...plication-dev/reference/apis/js-apis-inner-app-context.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegatorArgs.md
...ce/apis/js-apis-inner-application-abilityDelegatorArgs.md
+0
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityMonitor.md
...eference/apis/js-apis-inner-application-abilityMonitor.md
+0
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md
...n-dev/reference/apis/js-apis-inner-application-context.md
+0
-8
zh-cn/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md
...eference/apis/js-apis-inner-application-shellCmdResult.md
+0
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md
浏览文件 @
8cb9e6bd
...
@@ -44,8 +44,6 @@ getAbilityDelegator(): AbilityDelegator
...
@@ -44,8 +44,6 @@ getAbilityDelegator(): AbilityDelegator
**示例:**
**示例:**
```
ts
```
ts
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
want
=
{
let
want
=
{
...
@@ -78,8 +76,6 @@ getArguments(): AbilityDelegatorArgs
...
@@ -78,8 +76,6 @@ getArguments(): AbilityDelegatorArgs
**示例:**
**示例:**
```
ts
```
ts
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
let
args
=
AbilityDelegatorRegistry
.
getArguments
();
let
args
=
AbilityDelegatorRegistry
.
getArguments
();
console
.
info
(
'
getArguments bundleName:
'
+
args
.
bundleName
);
console
.
info
(
'
getArguments bundleName:
'
+
args
.
bundleName
);
console
.
info
(
'
getArguments parameters:
'
+
JSON
.
stringify
(
args
.
parameters
));
console
.
info
(
'
getArguments parameters:
'
+
JSON
.
stringify
(
args
.
parameters
));
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-missionManager.md
浏览文件 @
8cb9e6bd
...
@@ -20,7 +20,7 @@ ohos.permission.MANAGE_MISSIONS
...
@@ -20,7 +20,7 @@ ohos.permission.MANAGE_MISSIONS
on(type:'mission', listener: MissionListener): number;
on(type:'mission', listener: MissionListener): number;
注册系统任务状态监听。
注册系统任务状态监听
器
。
**需要权限**
:ohos.permission.MANAGE_MISSIONS
**需要权限**
:ohos.permission.MANAGE_MISSIONS
...
@@ -32,13 +32,13 @@ on(type:'mission', listener: MissionListener): number;
...
@@ -32,13 +32,13 @@ on(type:'mission', listener: MissionListener): number;
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| listener |
[
MissionListener
](
js-apis-inner-application-missionListener.md
)
| 是 | 系统任务监听
方法
。 |
| listener |
[
MissionListener
](
js-apis-inner-application-missionListener.md
)
| 是 | 系统任务监听
器
。 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
| number | 监听
方法的index值,由系统创建,在注册系统任务状态监听时分配,和监听方法
一一对应
。 |
| number | 监听
器的index值,由系统创建,在注册系统任务状态监听时分配,和监听器
一一对应
。 |
**示例:**
**示例:**
...
@@ -107,7 +107,7 @@ export default class EntryAbility extends UIAbility {
...
@@ -107,7 +107,7 @@ export default class EntryAbility extends UIAbility {
off(type: 'mission', listenerId: number, callback: AsyncCallback
<
void
>
): void;
off(type: 'mission', listenerId: number, callback: AsyncCallback
<
void
>
): void;
取消任务状态监听
。
解注册任务状态监听器
。
**需要权限**
:ohos.permission.MANAGE_MISSIONS
**需要权限**
:ohos.permission.MANAGE_MISSIONS
...
@@ -119,7 +119,7 @@ off(type: 'mission', listenerId: number, callback: AsyncCallback<void>): v
...
@@ -119,7 +119,7 @@ off(type: 'mission', listenerId: number, callback: AsyncCallback<void>): v
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| listenerId | number | 是 | 系统任务状态监
听方法的index值,和监听方法一一对应,由registerMissionListener
方法返回。 |
| listenerId | number | 是 | 系统任务状态监
器法的index值,和监听器一一对应,由on
方法返回。 |
| callback | AsyncCallback
<
void
>
| 是 | 执行结果回调函数。 |
| callback | AsyncCallback
<
void
>
| 是 | 执行结果回调函数。 |
**错误码**
:
**错误码**
:
...
@@ -197,7 +197,7 @@ export default class EntryAbility extends UIAbility {
...
@@ -197,7 +197,7 @@ export default class EntryAbility extends UIAbility {
off(type: 'mission', listenerId: number): Promise
<
void
>
;
off(type: 'mission', listenerId: number): Promise
<
void
>
;
取消
任务状态监听,以promise方式返回执行结果。
解注册
任务状态监听,以promise方式返回执行结果。
**需要权限**
:ohos.permission.MANAGE_MISSIONS
**需要权限**
:ohos.permission.MANAGE_MISSIONS
...
@@ -209,7 +209,7 @@ off(type: 'mission', listenerId: number): Promise<void>;
...
@@ -209,7 +209,7 @@ off(type: 'mission', listenerId: number): Promise<void>;
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| listenerId | number | 是 | 系统任务状态监听
方法的index值,和监听方法一一对应,由registerMissionListener
方法返回。 |
| listenerId | number | 是 | 系统任务状态监听
器的index值,和监听器一一对应,由on
方法返回。 |
**返回值:**
**返回值:**
...
@@ -313,23 +313,34 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<M
...
@@ -313,23 +313,34 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<M
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
let
testMissionId
=
1
;
missionManager
.
getMissionInfos
(
''
,
10
)
.
then
((
allMissions
)
=>
{
try
{
try
{
let
allMissions
=
missionManager
.
getMissionInfos
(
''
,
10
).
catch
(
function
(
err
){
console
.
log
(
err
);});
if
(
allMissions
&&
allMissions
.
length
>
0
)
{
missionManager
.
getMissionInfo
(
''
,
allMissions
[
0
].
missionId
,
(
error
,
mission
)
=>
{
testMissionId
=
allMissions
[
0
].
missionId
;
console
.
log
(
'
getMissionInfo is called, error.code =
'
+
error
.
code
);
}
console
.
log
(
'
mission.missionId =
'
+
mission
.
missionId
);
console
.
log
(
'
mission.runningState =
'
+
mission
.
runningState
);
missionManager
.
getMissionInfo
(
''
,
testMissionId
,
(
error
,
mission
)
=>
{
console
.
log
(
'
mission.lockedState =
'
+
mission
.
lockedState
);
if
(
error
)
{
console
.
log
(
'
mission.timestamp =
'
+
mission
.
timestamp
);
console
.
error
(
'
getMissionInfo failed, error.code: ${error.code}, error.message: ${error.message}
'
);
console
.
log
(
'
mission.label =
'
+
mission
.
label
);
}
else
{
console
.
log
(
'
mission.iconPath =
'
+
mission
.
iconPath
);
console
.
log
(
'
mission.missionId = ${mission.missionId}
'
);
console
.
log
(
'
mission.runningState = ${mission.runningState}
'
);
console
.
log
(
'
mission.lockedState = ${mission.lockedState}
'
);
console
.
log
(
'
mission.timestamp = ${mission.timestamp}
'
);
console
.
log
(
'
mission.label = ${mission.label}
'
);
console
.
log
(
'
mission.iconPath = ${mission.iconPath}
'
);
}
});
});
}
catch
(
paramError
)
{
}
catch
(
paramError
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
error.code: ${paramError.code}, error.message: ${paramError.message}
'
);
}
}
})
.
catch
(
function
(
err
){
console
.
log
(
err
);});
```
```
## missionManager.getMissionInfo
## missionManager.getMissionInfo
getMissionInfo(deviceId: string, missionId: number): Promise
<
MissionInfo
>
;
getMissionInfo(deviceId: string, missionId: number): Promise
<
MissionInfo
>
;
...
@@ -357,18 +368,20 @@ getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo>;
...
@@ -357,18 +368,20 @@ getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo>;
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
let
testMissionId
=
1
;
let
mission
=
missionManager
.
getMissionInfo
(
''
,
10
).
catch
(
function
(
err
){
try
{
console
.
log
(
err
);
missionManager
.
getMissionInfo
(
''
,
testMissionId
).
then
((
data
)
=>
{
console
.
info
(
'
getMissionInfo successfully. Data: ${JSON.stringify(data)}
'
);
}).
catch
(
error
=>
{
console
.
error
(
'
getMissionInfo failed. Cause: ${error.message}
'
);
});
});
}
catch
(
paramError
)
{
}
catch
(
error
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
getMissionInfo failed. Cause: ${error.message}
'
);
}
}
```
```
## missionManager.getMissionInfos
## missionManager.getMissionInfos
...
@@ -397,12 +410,15 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Arr
...
@@ -397,12 +410,15 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Arr
try
{
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
if
(
error
)
{
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
error
(
'
getMissionInfos failed, error.code: ${error.code}, error.message: ${error.message}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
}
else
{
console
.
log
(
'
size = ${missions.length}
'
);
console
.
log
(
'
missions = ${JSON.stringify(missions)}
'
);
}
});
});
}
catch
(
paramError
)
{
}
catch
(
paramError
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
}
```
```
...
@@ -434,18 +450,19 @@ getMissionInfos(deviceId: string, numMax: number): Promise<Array<MissionIn
...
@@ -434,18 +450,19 @@ getMissionInfos(deviceId: string, numMax: number): Promise<Array<MissionIn
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
try
{
let
allMissions
=
missionManager
.
getMissionInfos
(
''
,
10
).
catch
(
function
(
err
){
missionManager
.
getMissionInfos
(
''
,
10
).
then
((
data
)
=>
{
console
.
log
(
err
);
console
.
info
(
'
getMissionInfos successfully. Data: ${JSON.stringify(data)}
'
);
}).
catch
(
error
=>
{
console
.
error
(
'
getMissionInfos failed. Cause: ${error.message}
'
);
});
});
}
catch
(
paramError
)
{
}
catch
(
error
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
getMissionInfos failed. Cause: ${error.message}
'
);
}
}
```
```
## missionManager.getMissionSnapShot
## missionManager.getMissionSnapShot
...
@@ -468,27 +485,22 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback&
...
@@ -468,27 +485,22 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback&
| callback | AsyncCallback
<
[MissionSnapshot](js-apis-inner-application-missionSnapshot.md)
>
| 是 | 执行结果回调函数,返回任务快照信息。 |
| callback | AsyncCallback
<
[MissionSnapshot](js-apis-inner-application-missionSnapshot.md)
>
| 是 | 执行结果回调函数,返回任务快照信息。 |
**示例:**
**示例:**
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
```
ts
let
testMissionId
=
2
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
getMissionSnapShot
(
''
,
testMissionId
,
(
err
,
data
)
=>
{
try
{
if
(
err
)
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
error
(
'
getMissionSnapShot failed: ${err.message}
'
);
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
}
else
{
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
info
(
'
getMissionSnapShot successfully: ${JSON.stringify(data)}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
let
id
=
missions
[
0
].
missionId
;
missionManager
.
getMissionSnapShot
(
''
,
id
,
(
error
,
snapshot
)
=>
{
console
.
log
(
'
getMissionSnapShot is called, error.code =
'
+
error
.
code
);
console
.
log
(
'
bundleName =
'
+
snapshot
.
ability
.
bundleName
);
});
});
}
catch
(
paramError
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
}
}
```
});
}
catch
(
err
)
{
console
.
error
(
'
getMissionSnapShot failed: ${err.message}
'
);
}
```
## missionManager.getMissionSnapShot
## missionManager.getMissionSnapShot
...
@@ -516,32 +528,26 @@ getMissionSnapShot(deviceId: string, missionId: number): Promise<MissionSnaps
...
@@ -516,32 +528,26 @@ getMissionSnapShot(deviceId: string, missionId: number): Promise<MissionSnaps
| Promise
<
[MissionSnapshot](js-apis-inner-application-missionSnapshot.md)
>
| 任务快照信息。 |
| Promise
<
[MissionSnapshot](js-apis-inner-application-missionSnapshot.md)
>
| 任务快照信息。 |
**示例:**
**示例:**
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
```
ts
let
testMissionId
=
2
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
getMissionSnapShot
(
''
,
testMissionId
).
then
((
data
)
=>
{
try
{
console
.
info
(
'
getMissionSnapShot successfully. Data: ${JSON.stringify(data)}
'
);
let
allMissions
;
}).
catch
(
error
=>
{
missionManager
.
getMissionInfos
(
''
,
10
).
then
(
function
(
res
){
console
.
error
(
'
getMissionSnapShot failed. Cause: ${error.message}
'
);
allMissions
=
res
;
}).
catch
(
function
(
err
){
console
.
log
(
err
);});
console
.
log
(
'
size =
'
+
allMissions
.
length
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
allMissions
));
let
id
=
allMissions
[
0
].
missionId
;
let
snapshot
=
missionManager
.
getMissionSnapShot
(
''
,
id
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
});
}
catch
(
paramE
rror
)
{
}
catch
(
e
rror
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
getMissionSnapShot failed. Cause: ${error.message}
'
);
}
}
```
```
## missionManager.getLowResolutionMissionSnapShot
## missionManager.getLowResolutionMissionSnapShot
getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback
\<
MissionSnapshot>): void;
getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback
\<
MissionSnapshot>): void;
使用给定的任务ID
获取任务低分辨率快照。
获取任务低分辨率快照。
**需要权限**
:ohos.permission.MANAGE_MISSIONS
**需要权限**
:ohos.permission.MANAGE_MISSIONS
...
@@ -558,33 +564,28 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: A
...
@@ -558,33 +564,28 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: A
| callback | AsyncCallback
<
[MissionSnapshot](js-apis-inner-application-missionSnapshot.md)
>
| 是 | 执行结果回调函数,返回任务快照信息。 |
| callback | AsyncCallback
<
[MissionSnapshot](js-apis-inner-application-missionSnapshot.md)
>
| 是 | 执行结果回调函数,返回任务快照信息。 |
**示例:**
**示例:**
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
```
ts
let
testMissionId
=
2
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
getLowResolutionMissionSnapShot
(
''
,
testMissionId
,
(
err
,
data
)
=>
{
try
{
if
(
err
)
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
error
(
'
getLowResolutionMissionSnapShot failed: ${err.message}
'
);
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
}
else
{
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
info
(
'
getLowResolutionMissionSnapShot successfully: ${JSON.stringify(data)}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
let
id
=
missions
[
0
].
missionId
;
missionManager
.
getLowResolutionMissionSnapShot
(
''
,
id
,
(
error
,
snapshot
)
=>
{
console
.
log
(
'
getLowResolutionMissionSnapShot is called, error.code =
'
+
error
.
code
);
console
.
log
(
'
bundleName =
'
+
snapshot
.
ability
.
bundleName
);
});
});
}
catch
(
paramError
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
}
}
```
});
}
catch
(
err
)
{
console
.
error
(
'
getLowResolutionMissionSnapShot failed: ${err.message}
'
);
}
```
## missionManager.getLowResolutionMissionSnapShot
## missionManager.getLowResolutionMissionSnapShot
getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise
\<
MissionSnapshot>;
getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise
\<
MissionSnapshot>;
使用给定的任务ID
获取任务低分辨率快照。
获取任务低分辨率快照。
**需要权限**
:ohos.permission.MANAGE_MISSIONS
**需要权限**
:ohos.permission.MANAGE_MISSIONS
...
@@ -607,25 +608,20 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise\<M
...
@@ -607,25 +608,20 @@ getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise\<M
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
let
testMissionId
=
2
;
let
allMissions
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
).
then
(
function
(
res
){
missionManager
.
getLowResolutionMissionSnapShot
(
''
,
testMissionId
).
then
((
data
)
=>
{
allMissions
=
res
;
console
.
info
(
'
getLowResolutionMissionSnapShot successfully. Data: ${JSON.stringify(data)}
'
);
}).
catch
(
function
(
err
){
console
.
log
(
err
);});
}).
catch
(
error
=>
{
console
.
log
(
'
size =
'
+
allMissions
.
length
);
console
.
error
(
'
getLowResolutionMissionSnapShot failed. Cause: ${error.message}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
allMissions
));
let
id
=
allMissions
[
0
].
missionId
;
let
snapshot
=
missionManager
.
getLowResolutionMissionSnapShot
(
''
,
id
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
});
}
catch
(
paramE
rror
)
{
}
catch
(
e
rror
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
getLowResolutionMissionSnapShot failed. Cause: ${error.message}
'
);
}
}
```
```
## missionManager.lockMission
## missionManager.lockMission
...
@@ -657,25 +653,22 @@ lockMission(missionId: number, callback: AsyncCallback<void>): void;
...
@@ -657,25 +653,22 @@ lockMission(missionId: number, callback: AsyncCallback<void>): void;
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
let
id
=
missions
[
0
].
missionId
;
missionManager
.
lockMission
(
id
).
then
(()
=>
{
let
testMissionId
=
2
;
console
.
log
(
'
lockMission is called
'
);
try
{
});
missionManager
.
lockMission
(
testMissionId
,
(
err
,
data
)
=>
{
});
if
(
err
)
{
}
catch
(
paramError
)
{
console
.
error
(
'
lockMission failed: ${err.message}
'
);
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
}
else
{
console
.
info
(
'
lockMission successfully: ${JSON.stringify(data)}
'
);
}
}
```
});
}
catch
(
err
)
{
console
.
error
(
'
lockMission failed: ${err.message}
'
);
}
```
## missionManager.lockMission
## missionManager.lockMission
...
@@ -710,27 +703,20 @@ lockMission(missionId: number): Promise<void>;
...
@@ -710,27 +703,20 @@ lockMission(missionId: number): Promise<void>;
以上错误码详细介绍请参考
[
errcode-ability
](
../errorcodes/errorcode-ability.md
)
。
以上错误码详细介绍请参考
[
errcode-ability
](
../errorcodes/errorcode-ability.md
)
。
**示例:**
**示例:**
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
```
ts
let
testMissionId
=
2
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
lockMission
(
testMissionId
).
then
((
data
)
=>
{
try
{
console
.
info
(
'
lockMission successfully. Data: ${JSON.stringify(data)}
'
);
let
allMissions
;
}).
catch
(
error
=>
{
missionManager
.
getMissionInfos
(
''
,
10
).
then
(
function
(
res
){
console
.
error
(
'
lockMission failed. Cause: ${error.message}
'
);
allMissions
=
res
;
}).
catch
(
function
(
err
){
console
.
log
(
err
);});
console
.
log
(
'
size =
'
+
allMissions
.
length
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
allMissions
));
let
id
=
allMissions
[
0
].
missionId
;
missionManager
.
lockMission
(
id
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
});
}
catch
(
paramError
)
{
}
catch
(
error
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
lockMission failed. Cause: ${error.message}
'
);
}
}
```
```
## missionManager.unlockMission
## missionManager.unlockMission
...
@@ -760,26 +746,22 @@ unlockMission(missionId: number, callback: AsyncCallback<void>): void;
...
@@ -760,26 +746,22 @@ unlockMission(missionId: number, callback: AsyncCallback<void>): void;
以上错误码详细介绍请参考
[
errcode-ability
](
../errorcodes/errorcode-ability.md
)
。
以上错误码详细介绍请参考
[
errcode-ability
](
../errorcodes/errorcode-ability.md
)
。
**示例:**
**示例:**
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
```
ts
let
testMissionId
=
2
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
unlockMission
(
testMissionId
,
(
err
,
data
)
=>
{
try
{
if
(
err
)
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
error
(
'
unlockMission failed: ${err.message}
'
);
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
}
else
{
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
info
(
'
unlockMission successfully: ${JSON.stringify(data)}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
let
id
=
missions
[
0
].
missionId
;
missionManager
.
unlockMission
(
id
).
then
(()
=>
{
console
.
log
(
'
unlockMission is called
'
);
});
});
}
catch
(
paramError
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
}
}
```
});
}
catch
(
err
)
{
console
.
error
(
'
unlockMission failed: ${err.message}
'
);
}
```
## missionManager.unlockMission
## missionManager.unlockMission
...
@@ -815,29 +797,20 @@ unlockMission(missionId: number): Promise<void>;
...
@@ -815,29 +797,20 @@ unlockMission(missionId: number): Promise<void>;
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
let
testMissionId
=
2
;
let
allMissions
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
).
then
(
function
(
res
){
missionManager
.
unlockMission
(
testMissionId
).
then
((
data
)
=>
{
allMissions
=
res
;
console
.
info
(
'
unlockMission successfully. Data: ${JSON.stringify(data)}
'
);
}).
catch
(
function
(
err
){
console
.
log
(
err
);});
}).
catch
(
error
=>
{
console
.
log
(
'
size =
'
+
allMissions
.
length
);
console
.
error
(
'
unlockMission failed. Cause: ${error.message}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
allMissions
));
let
id
=
allMissions
[
0
].
missionId
;
missionManager
.
lockMission
(
id
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
missionManager
.
unlockMission
(
id
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
});
}
catch
(
paramError
)
{
}
catch
(
error
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
unlockMission failed. Cause: ${error.message}
'
);
}
}
```
```
## missionManager.clearMission
## missionManager.clearMission
...
@@ -860,24 +833,22 @@ clearMission(missionId: number, callback: AsyncCallback<void>): void;
...
@@ -860,24 +833,22 @@ clearMission(missionId: number, callback: AsyncCallback<void>): void;
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
let
id
=
missions
[
0
].
missionId
;
missionManager
.
clearMission
(
id
).
then
(()
=>
{
let
testMissionId
=
2
;
console
.
log
(
'
clearMission is called
'
);
try
{
});
missionManager
.
clearMission
(
testMissionId
,
(
err
,
data
)
=>
{
});
if
(
err
)
{
}
catch
(
paramError
)
{
console
.
error
(
'
clearMission failed: ${err.message}
'
);
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
}
else
{
console
.
info
(
'
clearMission successfully: ${JSON.stringify(data)}
'
);
}
}
```
});
}
catch
(
err
)
{
console
.
error
(
'
clearMission failed: ${err.message}
'
);
}
```
## missionManager.clearMission
## missionManager.clearMission
...
@@ -906,26 +877,20 @@ clearMission(missionId: number): Promise<void>;
...
@@ -906,26 +877,20 @@ clearMission(missionId: number): Promise<void>;
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
let
testMissionId
=
2
;
let
allMissions
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
).
then
(
function
(
res
){
missionManager
.
clearMission
(
testMissionId
).
then
((
data
)
=>
{
allMissions
=
res
;
console
.
info
(
'
clearMission successfully. Data: ${JSON.stringify(data)}
'
);
}).
catch
(
function
(
err
){
console
.
log
(
err
);});
}).
catch
(
error
=>
{
console
.
log
(
'
size =
'
+
allMissions
.
length
);
console
.
error
(
'
clearMission failed. Cause: ${error.message}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
allMissions
));
let
id
=
allMissions
[
0
].
missionId
;
missionManager
.
clearMission
(
id
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
});
}
catch
(
paramError
)
{
}
catch
(
error
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
clearMission failed. Cause: ${error.message}
'
);
}
}
```
```
## missionManager.clearAllMissions
## missionManager.clearAllMissions
...
@@ -941,14 +906,21 @@ clearAllMissions(callback: AsyncCallback<void>): void;
...
@@ -941,14 +906,21 @@ clearAllMissions(callback: AsyncCallback<void>): void;
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
missionManager
.
clearAllMissions
().
then
(()
=>
{
try
{
console
.
log
(
'
clearAllMissions is called
'
);
missionManager
.
clearAllMissions
(
err
=>
{
if
(
err
)
{
console
.
error
(
'
clearAllMissions failed: ${err.message}
'
);
}
else
{
console
.
info
(
'
clearAllMissions successfully.
'
);
}
});
});
```
}
catch
(
err
)
{
console
.
error
(
'
clearAllMissions failed: ${err.message}
'
);
}
```
## missionManager.clearAllMissions
## missionManager.clearAllMissions
...
@@ -970,13 +942,19 @@ clearAllMissions(): Promise<void>;
...
@@ -970,13 +942,19 @@ clearAllMissions(): Promise<void>;
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
missionManager
.
clearAllMissions
().
catch
(
function
(
err
){
console
.
log
(
err
);
});
```
try
{
missionManager
.
clearAllMissions
(
bundleName
).
then
((
data
)
=>
{
console
.
info
(
'
clearAllMissions successfully. Data: ${JSON.stringify(data)}
'
);
}).
catch
(
err
=>
{
console
.
error
(
'
clearAllMissions failed: ${err.message}
'
);
});
}
catch
(
err
)
{
console
.
error
(
'
clearAllMissions failed: ${err.message}
'
);
}
```
## missionManager.moveMissionToFront
## missionManager.moveMissionToFront
...
@@ -1007,25 +985,22 @@ moveMissionToFront(missionId: number, callback: AsyncCallback<void>): void
...
@@ -1007,25 +985,22 @@ moveMissionToFront(missionId: number, callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
let
id
=
missions
[
0
].
missionId
;
missionManager
.
moveMissionToFront
(
id
).
then
(()
=>
{
let
testMissionId
=
2
;
console
.
log
(
'
moveMissionToFront is called
'
);
try
{
});
missionManager
.
moveMissionToFront
(
testMissionId
,
(
err
,
data
)
=>
{
});
if
(
err
)
{
}
catch
(
paramError
)
{
console
.
error
(
'
moveMissionToFront failed: ${err.message}
'
);
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
}
else
{
console
.
info
(
'
moveMissionToFront successfully: ${JSON.stringify(data)}
'
);
}
}
```
});
}
catch
(
err
)
{
console
.
error
(
'
moveMissionToFront failed: ${err.message}
'
);
}
```
## missionManager.moveMissionToFront
## missionManager.moveMissionToFront
...
@@ -1057,25 +1032,22 @@ moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCall
...
@@ -1057,25 +1032,22 @@ moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCall
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
console
.
log
(
'
getMissionInfos is called, error.code =
'
+
error
.
code
);
console
.
log
(
'
size =
'
+
missions
.
length
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
missions
));
let
id
=
missions
[
0
].
missionId
;
missionManager
.
moveMissionToFront
(
id
,{
windowMode
:
101
}).
then
(()
=>
{
let
testMissionId
=
2
;
console
.
log
(
'
moveMissionToFront is called
'
);
try
{
});
missionManager
.
moveMissionToFront
(
testMissionId
,
{
windowMode
:
101
},
(
err
,
data
)
=>
{
});
if
(
err
)
{
}
catch
(
paramError
)
{
console
.
error
(
'
moveMissionToFront failed: ${err.message}
'
);
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
}
else
{
console
.
info
(
'
moveMissionToFront successfully: ${JSON.stringify(data)}
'
);
}
}
```
});
}
catch
(
err
)
{
console
.
error
(
'
moveMissionToFront failed: ${err.message}
'
);
}
```
## missionManager.moveMissionToFront
## missionManager.moveMissionToFront
...
@@ -1112,22 +1084,17 @@ moveMissionToFront(missionId: number, options?: StartOptions): Promise<void&g
...
@@ -1112,22 +1084,17 @@ moveMissionToFront(missionId: number, options?: StartOptions): Promise<void&g
**示例:**
**示例:**
```
ts
```
ts
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
import
missionManager
from
'
@ohos.app.ability.missionManager
'
;
try
{
let
testMissionId
=
2
;
let
allMissions
;
try
{
missionManager
.
getMissionInfos
(
''
,
10
).
then
(
function
(
res
){
missionManager
.
moveMissionToFront
(
testMissionId
).
then
((
data
)
=>
{
allMissions
=
res
;
console
.
info
(
'
moveMissionToFront successfully. Data: ${JSON.stringify(data)}
'
);
}).
catch
(
function
(
err
){
console
.
log
(
err
);});
}).
catch
(
error
=>
{
console
.
log
(
'
size =
'
+
allMissions
.
length
);
console
.
error
(
'
moveMissionToFront failed. Cause: ${error.message}
'
);
console
.
log
(
'
missions =
'
+
JSON
.
stringify
(
allMissions
));
let
id
=
allMissions
[
0
].
missionId
;
missionManager
.
moveMissionToFront
(
id
).
catch
(
function
(
err
){
console
.
log
(
err
);
});
});
}
catch
(
paramE
rror
)
{
}
catch
(
e
rror
)
{
console
.
log
(
'
error:
'
+
paramError
.
code
+
'
,
'
+
paramError
.
message
);
console
.
error
(
'
moveMissionToFront failed. Cause: ${error.message}
'
);
}
}
```
```
zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityHelper.md
浏览文件 @
8cb9e6bd
...
@@ -110,7 +110,7 @@ let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelpe
...
@@ -110,7 +110,7 @@ let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelpe
function
onChangeNotify
()
{
function
onChangeNotify
()
{
console
.
info
(
'
==========================>onChangeNotify=======================>
'
);
console
.
info
(
'
==========================>onChangeNotify=======================>
'
);
};
};
h
elper
.
on
(
DAH
elper
.
on
(
'
dataChange
'
,
'
dataChange
'
,
'
dataability:///com.example.DataAbility
'
,
'
dataability:///com.example.DataAbility
'
,
onChangeNotify
onChangeNotify
...
@@ -143,11 +143,11 @@ let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelpe
...
@@ -143,11 +143,11 @@ let DAHelper: ability.DataAbilityHelper = featureAbility.acquireDataAbilityHelpe
function
onChangeNotify
()
{
function
onChangeNotify
()
{
console
.
info
(
'
==========================>onChangeNotify=======================>
'
);
console
.
info
(
'
==========================>onChangeNotify=======================>
'
);
};
};
h
elper
.
off
(
DAH
elper
.
off
(
'
dataChange
'
,
'
dataChange
'
,
'
dataability:///com.example.DataAbility
'
,
'
dataability:///com.example.DataAbility
'
,
);
);
h
elper
.
off
(
DAH
elper
.
off
(
'
dataChange
'
,
'
dataChange
'
,
'
dataability:///com.example.DataAbility
'
,
'
dataability:///com.example.DataAbility
'
,
onChangeNotify
onChangeNotify
...
@@ -420,7 +420,7 @@ import featureAbility from '@ohos.ability.featureAbility';
...
@@ -420,7 +420,7 @@ import featureAbility from '@ohos.ability.featureAbility';
let
DAHelper
:
ability
.
DataAbilityHelper
=
featureAbility
.
acquireDataAbilityHelper
(
let
DAHelper
:
ability
.
DataAbilityHelper
=
featureAbility
.
acquireDataAbilityHelper
(
'
dataability:///com.example.DataAbility
'
'
dataability:///com.example.DataAbility
'
);
);
h
elper
.
notifyChange
(
'
dataability:///com.example.DataAbility
'
,
(
err
)
=>
{
DAH
elper
.
notifyChange
(
'
dataability:///com.example.DataAbility
'
,
(
err
)
=>
{
console
.
info
(
'
==========================>Called=======================>
'
);
console
.
info
(
'
==========================>Called=======================>
'
);
});
});
```
```
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-app-context.md
浏览文件 @
8cb9e6bd
...
@@ -106,7 +106,7 @@ import featureAbility from '@ohos.ability.featureAbility';
...
@@ -106,7 +106,7 @@ import featureAbility from '@ohos.ability.featureAbility';
import
bundle
from
'
@ohos.bundle.bundleManager
'
;
import
bundle
from
'
@ohos.bundle.bundleManager
'
;
let
context
:
featureAbility
.
Context
=
featureAbility
.
getContext
();
let
context
:
featureAbility
.
Context
=
featureAbility
.
getContext
();
bundle
.
getBundleInfo
(
'
com.context.test
'
,
1
,
(
err
,
datainfo
)
=>
{
bundle
.
getBundleInfo
(
'
com.context.test
'
,
1
,
(
err
,
datainfo
)
=>
{
context
.
verifyPermission
(
'
com.example.permission
'
,
{
uid
:
datainfo
.
uid
},
(
err
,
data
)
=>
{
context
.
verifyPermission
(
'
com.example.permission
'
,
{
uid
:
datainfo
.
appInfo
.
uid
},
(
err
,
data
)
=>
{
console
.
info
(
'
verifyPermission err:
'
+
JSON
.
stringify
(
err
)
+
'
data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
verifyPermission err:
'
+
JSON
.
stringify
(
err
)
+
'
data:
'
+
JSON
.
stringify
(
data
));
});
});
});
});
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegatorArgs.md
浏览文件 @
8cb9e6bd
...
@@ -32,7 +32,5 @@ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry
...
@@ -32,7 +32,5 @@ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry
**示例:**
**示例:**
```
ts
```
ts
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
;
let
args
:
AbilityDelegatorRegistry
.
AbilityDelegatorArgs
=
AbilityDelegatorRegistry
.
getArguments
();
let
args
:
AbilityDelegatorRegistry
.
AbilityDelegatorArgs
=
AbilityDelegatorRegistry
.
getArguments
();
```
```
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityMonitor.md
浏览文件 @
8cb9e6bd
...
@@ -37,8 +37,6 @@ Ability监听器
...
@@ -37,8 +37,6 @@ Ability监听器
**示例:**
**示例:**
```
ts
```
ts
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
;
function
onAbilityCreateCallback
(
data
)
{
function
onAbilityCreateCallback
(
data
)
{
console
.
info
(
'
onAbilityCreateCallback
'
);
console
.
info
(
'
onAbilityCreateCallback
'
);
}
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md
浏览文件 @
8cb9e6bd
...
@@ -122,16 +122,12 @@ createModuleContext(bundleName: string, moduleName: string): Context;
...
@@ -122,16 +122,12 @@ createModuleContext(bundleName: string, moduleName: string): Context;
**示例:**
**示例:**
```
ts
```
ts
<<<<<<<
HEAD
let
moduleContext
=
this
.
context
.
createModuleContext
(
'
com.example.test
'
,
'
entry
'
);
=======
let
moduleContext
:
common
.
Context
;
let
moduleContext
:
common
.
Context
;
try
{
try
{
moduleContext
=
this
.
context
.
createModuleContext
(
'
com.example.test
'
,
'
entry
'
);
moduleContext
=
this
.
context
.
createModuleContext
(
'
com.example.test
'
,
'
entry
'
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'
createModuleContext failed, error.code: ${error.code}, error.message: ${error.message}
'
);
console
.
error
(
'
createModuleContext failed, error.code: ${error.code}, error.message: ${error.message}
'
);
}
}
>>>>>>>
48
a75c8e72
(
Modify
the
secondary
import
module
of
ability
)
```
```
## Context.getApplicationContext
## Context.getApplicationContext
...
@@ -151,16 +147,12 @@ getApplicationContext(): ApplicationContext;
...
@@ -151,16 +147,12 @@ getApplicationContext(): ApplicationContext;
**示例:**
**示例:**
```
ts
```
ts
<<<<<<<
HEAD
let
applicationContext
=
this
.
context
.
getApplicationContext
();
=======
let
applicationContext
:
common
.
Context
;
let
applicationContext
:
common
.
Context
;
try
{
try
{
applicationContext
=
this
.
context
.
getApplicationContext
();
applicationContext
=
this
.
context
.
getApplicationContext
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'
getApplicationContext failed, error.code: ${error.code}, error.message: ${error.message}
'
);
console
.
error
(
'
getApplicationContext failed, error.code: ${error.code}, error.message: ${error.message}
'
);
}
}
>>>>>>>
48
a75c8e72
(
Modify
the
secondary
import
module
of
ability
)
```
```
## AreaMode
## AreaMode
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md
浏览文件 @
8cb9e6bd
...
@@ -25,7 +25,6 @@ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry
...
@@ -25,7 +25,6 @@ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry
**示例:**
**示例:**
```
ts
```
ts
import
AbilityDelegatorRegistry
from
'
@ohos.app.ability.abilityDelegatorRegistry
'
;
let
abilityDelegator
:
AbilityDelegatorRegistry
.
AbilityDelegator
;
let
abilityDelegator
:
AbilityDelegatorRegistry
.
AbilityDelegator
;
let
cmd
=
'
cmd
'
;
let
cmd
=
'
cmd
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录