Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
5ab746c7
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
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看板
提交
5ab746c7
编写于
1月 16, 2023
作者:
D
donglin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
示例代码修改
Signed-off-by:
N
donglin
<
donglin9@huawei.com
>
Change-Id: Iecbf0e576f90fc5a4f004da8cbcf7c9ad1fd8f1e
上级
4721f767
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
17 deletion
+17
-17
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md
...ence/apis/js-apis-app-ability-abilityDelegatorRegistry.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityLifecycleCallback.md
...ence/apis/js-apis-app-ability-abilityLifecycleCallback.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
...-dev/reference/apis/js-apis-app-ability-abilityManager.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
...tion-dev/reference/apis/js-apis-app-ability-appManager.md
+9
-9
zh-cn/application-dev/reference/apis/js-apis-inner-application-errorObserver.md
...reference/apis/js-apis-inner-application-errorObserver.md
+2
-2
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityDelegatorRegistry.md
浏览文件 @
5ab746c7
...
@@ -53,7 +53,7 @@ let want = {
...
@@ -53,7 +53,7 @@ let want = {
abilityName
:
"
EntryAbility
"
abilityName
:
"
EntryAbility
"
};
};
abilityDelegator
.
startAbility
(
want
,
(
err
)
=>
{
abilityDelegator
.
startAbility
(
want
,
(
err
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
Success start ability.
"
);
console
.
log
(
"
Success start ability.
"
);
}
else
{
}
else
{
console
.
log
(
"
Failed start ability, error:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
Failed start ability, error:
"
+
JSON
.
stringify
(
err
));
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityLifecycleCallback.md
浏览文件 @
5ab746c7
...
@@ -292,7 +292,7 @@ export default class MySecondAbility extends UIAbility {
...
@@ -292,7 +292,7 @@ export default class MySecondAbility extends UIAbility {
let
applicationContext
=
this
.
context
.
getApplicationContext
();
let
applicationContext
=
this
.
context
.
getApplicationContext
();
// 3.通过applicationContext注销监听应用内生命周期
// 3.通过applicationContext注销监听应用内生命周期
applicationContext
.
off
(
"
abilityLifecycle
"
,
globalThis
.
lifecycleId
,
(
error
)
=>
{
applicationContext
.
off
(
"
abilityLifecycle
"
,
globalThis
.
lifecycleId
,
(
error
)
=>
{
if
(
error
.
code
!=
0
)
{
if
(
error
&&
error
.
code
!=
0
)
{
console
.
log
(
"
unregisterAbilityLifecycleCallback failed, error:
"
+
JSON
.
stringify
(
error
));
console
.
log
(
"
unregisterAbilityLifecycleCallback failed, error:
"
+
JSON
.
stringify
(
error
));
}
else
{
}
else
{
console
.
log
(
"
unregisterAbilityLifecycleCallback success.
"
);
console
.
log
(
"
unregisterAbilityLifecycleCallback success.
"
);
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
浏览文件 @
5ab746c7
...
@@ -70,7 +70,7 @@ const config = {
...
@@ -70,7 +70,7 @@ const config = {
try
{
try
{
abilityManager
.
updateConfiguration
(
config
,
(
err
)
=>
{
abilityManager
.
updateConfiguration
(
config
,
(
err
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
updateConfiguration fail, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
updateConfiguration fail, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
updateConfiguration success.
"
);
console
.
log
(
"
updateConfiguration success.
"
);
...
@@ -169,7 +169,7 @@ import abilityManager from '@ohos.app.ability.abilityManager';
...
@@ -169,7 +169,7 @@ import abilityManager from '@ohos.app.ability.abilityManager';
try
{
try
{
abilityManager
.
getAbilityRunningInfos
((
err
,
data
)
=>
{
abilityManager
.
getAbilityRunningInfos
((
err
,
data
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
getAbilityRunningInfos fail, error:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getAbilityRunningInfos fail, error:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
getAbilityRunningInfos success, data:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
getAbilityRunningInfos success, data:
"
+
JSON
.
stringify
(
data
));
...
@@ -256,7 +256,7 @@ let upperLimit = 10;
...
@@ -256,7 +256,7 @@ let upperLimit = 10;
try
{
try
{
abilityManager
.
getExtensionRunningInfos
(
upperLimit
,
(
err
,
data
)
=>
{
abilityManager
.
getExtensionRunningInfos
(
upperLimit
,
(
err
,
data
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
getExtensionRunningInfos fail, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getExtensionRunningInfos fail, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
getExtensionRunningInfos success, data:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
getExtensionRunningInfos success, data:
"
+
JSON
.
stringify
(
data
));
...
@@ -345,7 +345,7 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void;
...
@@ -345,7 +345,7 @@ getTopAbility(callback: AsyncCallback\<ElementName>): void;
import
abilityManager
from
'
@ohos.app.ability.abilityManager
'
;
import
abilityManager
from
'
@ohos.app.ability.abilityManager
'
;
abilityManager
.
getTopAbility
((
err
,
data
)
=>
{
abilityManager
.
getTopAbility
((
err
,
data
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
getTopAbility fail, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getTopAbility fail, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
getTopAbility success, data:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
getTopAbility success, data:
"
+
JSON
.
stringify
(
data
));
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
浏览文件 @
5ab746c7
...
@@ -40,7 +40,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void
...
@@ -40,7 +40,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void
import
appManager
from
'
@ohos.app.ability.appManager
'
;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
isRunningInStabilityTest
((
err
,
flag
)
=>
{
appManager
.
isRunningInStabilityTest
((
err
,
flag
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
isRunningInStabilityTest faile, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
isRunningInStabilityTest faile, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
The result of isRunningInStabilityTest is:
"
+
JSON
.
stringify
(
flag
));
console
.
log
(
"
The result of isRunningInStabilityTest is:
"
+
JSON
.
stringify
(
flag
));
...
@@ -146,7 +146,7 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
...
@@ -146,7 +146,7 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
isRamConstrainedDevice
((
err
,
data
)
=>
{
appManager
.
isRamConstrainedDevice
((
err
,
data
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
isRamConstrainedDevice faile, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
isRamConstrainedDevice faile, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
The result of isRamConstrainedDevice is:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
The result of isRamConstrainedDevice is:
"
+
JSON
.
stringify
(
data
));
...
@@ -216,7 +216,7 @@ getAppMemorySize(callback: AsyncCallback\<number>): void;
...
@@ -216,7 +216,7 @@ getAppMemorySize(callback: AsyncCallback\<number>): void;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getAppMemorySize
((
err
,
data
)
=>
{
appManager
.
getAppMemorySize
((
err
,
data
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
getAppMemorySize faile, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getAppMemorySize faile, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
The size of app memory is:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
The size of app memory is:
"
+
JSON
.
stringify
(
data
));
...
@@ -294,7 +294,7 @@ getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInfor
...
@@ -294,7 +294,7 @@ getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInfor
import
appManager
from
'
@ohos.app.ability.appManager
'
;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
appManager
.
getProcessRunningInformation
((
err
,
data
)
=>
{
appManager
.
getProcessRunningInformation
((
err
,
data
)
=>
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
getProcessRunningInformation faile, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getProcessRunningInformation faile, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
The process running information is:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
The process running information is:
"
+
JSON
.
stringify
(
data
));
...
@@ -493,7 +493,7 @@ try {
...
@@ -493,7 +493,7 @@ try {
// 2.注销应用状态监听器
// 2.注销应用状态监听器
function
unregisterApplicationStateObserverCallback
(
err
)
{
function
unregisterApplicationStateObserverCallback
(
err
)
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
unregisterApplicationStateObserverCallback faile, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
unregisterApplicationStateObserverCallback faile, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
unregisterApplicationStateObserverCallback success.
"
);
console
.
log
(
"
unregisterApplicationStateObserverCallback success.
"
);
...
@@ -616,7 +616,7 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void;
...
@@ -616,7 +616,7 @@ getForegroundApplications(callback: AsyncCallback\<Array\<AppStateData>>): void;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
import
appManager
from
'
@ohos.app.ability.appManager
'
;
function
getForegroundApplicationsCallback
(
err
,
data
)
{
function
getForegroundApplicationsCallback
(
err
,
data
)
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
getForegroundApplicationsCallback fail, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getForegroundApplicationsCallback fail, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
getForegroundApplicationsCallback success, data:
"
+
JSON
.
stringify
(
data
));
console
.
log
(
"
getForegroundApplicationsCallback success, data:
"
+
JSON
.
stringify
(
data
));
...
@@ -749,7 +749,7 @@ import appManager from '@ohos.app.ability.appManager';
...
@@ -749,7 +749,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
let
bundleName
=
'
bundleName
'
;
let
accountId
=
0
;
let
accountId
=
0
;
function
killProcessWithAccountCallback
(
err
,
data
)
{
function
killProcessWithAccountCallback
(
err
,
data
)
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
killProcessWithAccountCallback fail, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
killProcessWithAccountCallback fail, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
killProcessWithAccountCallback success.
"
);
console
.
log
(
"
killProcessWithAccountCallback success.
"
);
...
@@ -792,7 +792,7 @@ import appManager from '@ohos.app.ability.appManager';
...
@@ -792,7 +792,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
let
bundleName
=
'
bundleName
'
;
function
killProcessesByBundleNameCallback
(
err
,
data
)
{
function
killProcessesByBundleNameCallback
(
err
,
data
)
{
if
(
err
.
code
!==
0
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
killProcessesByBundleNameCallback fail, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
killProcessesByBundleNameCallback fail, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
killProcessesByBundleNameCallback success.
"
);
console
.
log
(
"
killProcessesByBundleNameCallback success.
"
);
...
@@ -888,7 +888,7 @@ import appManager from '@ohos.app.ability.appManager';
...
@@ -888,7 +888,7 @@ import appManager from '@ohos.app.ability.appManager';
let
bundleName
=
'
bundleName
'
;
let
bundleName
=
'
bundleName
'
;
function
clearUpApplicationDataCallback
(
err
,
data
)
{
function
clearUpApplicationDataCallback
(
err
,
data
)
{
if
(
err
)
{
if
(
err
&&
err
.
code
!==
0
)
{
console
.
log
(
"
clearUpApplicationDataCallback fail, err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
clearUpApplicationDataCallback fail, err:
"
+
JSON
.
stringify
(
err
));
}
else
{
}
else
{
console
.
log
(
"
clearUpApplicationDataCallback success.
"
);
console
.
log
(
"
clearUpApplicationDataCallback success.
"
);
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-errorObserver.md
浏览文件 @
5ab746c7
...
@@ -19,11 +19,11 @@ onUnhandledException(errMsg: string): void;
...
@@ -19,11 +19,11 @@ onUnhandledException(errMsg: string): void;
**示例:**
**示例:**
```
ts
```
ts
import
errorManager
from
'
@ohos.app.ability.errorManager
'
import
errorManager
from
'
@ohos.app.ability.errorManager
'
;
let
observer
=
{
let
observer
=
{
onUnhandledException
(
errorMsg
)
{
onUnhandledException
(
errorMsg
)
{
console
.
log
(
'
HXW
onUnhandledException, errorMsg:
'
,
errorMsg
);
console
.
log
(
'
onUnhandledException, errorMsg:
'
,
errorMsg
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录