Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
1464c319
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看板
提交
1464c319
编写于
5月 11, 2023
作者:
zyjhandsome
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
正常打印,统一修改为console.info
Signed-off-by:
zyjhandsome
<
zyjhandsome@126.com
>
上级
a01be59f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
30 addition
and
30 deletion
+30
-30
zh-cn/application-dev/application-models/accessibilityextensionability.md
...n-dev/application-models/accessibilityextensionability.md
+5
-5
zh-cn/application-dev/application-models/application-context-stage.md
...ation-dev/application-models/application-context-stage.md
+14
-14
zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md
...dev/application-models/arkts-ui-widget-event-uiability.md
+1
-1
zh-cn/application-dev/application-models/common-event-static-subscription.md
...ev/application-models/common-event-static-subscription.md
+1
-1
zh-cn/application-dev/application-models/hop-multi-device-collaboration.md
...-dev/application-models/hop-multi-device-collaboration.md
+2
-2
zh-cn/application-dev/application-models/inputmethodextentionability.md
...ion-dev/application-models/inputmethodextentionability.md
+1
-1
zh-cn/application-dev/application-models/serviceextensionability.md
...ication-dev/application-models/serviceextensionability.md
+5
-5
zh-cn/application-dev/application-models/windowextensionability.md
...lication-dev/application-models/windowextensionability.md
+1
-1
未找到文件。
zh-cn/application-dev/application-models/accessibilityextensionability.md
浏览文件 @
1464c319
...
...
@@ -38,15 +38,15 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens
class
AccessibilityExtAbility
extends
AccessibilityExtensionAbility
{
onConnect
()
{
console
.
log
(
'
AccessibilityExtAbility onConnect
'
);
console
.
info
(
'
AccessibilityExtAbility onConnect
'
);
}
onDisconnect
()
{
console
.
log
(
'
AccessibilityExtAbility onDisconnect
'
);
console
.
info
(
'
AccessibilityExtAbility onDisconnect
'
);
}
onAccessibilityEvent
(
accessibilityEvent
)
{
console
.
log
(
'
AccessibilityExtAbility onAccessibilityEvent:
'
+
JSON
.
stringify
(
accessibilityEvent
));
console
.
info
(
'
AccessibilityExtAbility onAccessibilityEvent:
'
+
JSON
.
stringify
(
accessibilityEvent
));
}
}
...
...
@@ -67,9 +67,9 @@ export default AccessibilityExtAbility;
```
typescript
onAccessibilityEvent
(
accessibilityEvent
)
{
console
.
log
(
'
AccessibilityExtAbility onAccessibilityEvent:
'
+
JSON
.
stringify
(
accessibilityEvent
));
console
.
info
(
'
AccessibilityExtAbility onAccessibilityEvent:
'
+
JSON
.
stringify
(
accessibilityEvent
));
if
(
accessibilityEvent
.
eventType
===
'
pageStateUpdate
'
)
{
console
.
log
(
'
AccessibilityExtAbility onAccessibilityEvent: pageStateUpdate
'
);
console
.
info
(
'
AccessibilityExtAbility onAccessibilityEvent: pageStateUpdate
'
);
// TODO: 自定义相关逻辑开发
}
}
...
...
zh-cn/application-dev/application-models/application-context-stage.md
浏览文件 @
1464c319
...
...
@@ -262,50 +262,50 @@ export default class EntryAbility extends UIAbility {
let
abilityLifecycleCallback
=
{
// 当UIAbility创建时被调用
onAbilityCreate
(
uiAbility
)
{
console
.
log
(
TAG
,
`onAbilityCreate uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onAbilityCreate uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
},
// 当窗口创建时被调用
onWindowStageCreate
(
uiAbility
,
windowStage
:
window
.
WindowStage
)
{
console
.
log
(
TAG
,
`onWindowStageCreate uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
log
(
TAG
,
`onWindowStageCreate windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
console
.
info
(
TAG
,
`onWindowStageCreate uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onWindowStageCreate windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
},
// 当窗口处于活动状态时被调用
onWindowStageActive
(
uiAbility
,
windowStage
:
window
.
WindowStage
)
{
console
.
log
(
TAG
,
`onWindowStageActive uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
log
(
TAG
,
`onWindowStageActive windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
console
.
info
(
TAG
,
`onWindowStageActive uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onWindowStageActive windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
},
// 当窗口处于非活动状态时被调用
onWindowStageInactive
(
uiAbility
,
windowStage
:
window
.
WindowStage
)
{
console
.
log
(
TAG
,
`onWindowStageInactive uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
log
(
TAG
,
`onWindowStageInactive windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
console
.
info
(
TAG
,
`onWindowStageInactive uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onWindowStageInactive windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
},
// 当窗口被销毁时被调用
onWindowStageDestroy
(
uiAbility
,
windowStage
:
window
.
WindowStage
)
{
console
.
log
(
TAG
,
`onWindowStageDestroy uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
log
(
TAG
,
`onWindowStageDestroy windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
console
.
info
(
TAG
,
`onWindowStageDestroy uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onWindowStageDestroy windowStage:
${
JSON
.
stringify
(
windowStage
)}
`
);
},
// 当UIAbility被销毁时被调用
onAbilityDestroy
(
uiAbility
)
{
console
.
log
(
TAG
,
`onAbilityDestroy uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onAbilityDestroy uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
},
// 当UIAbility从后台转到前台时触发回调
onAbilityForeground
(
uiAbility
)
{
console
.
log
(
TAG
,
`onAbilityForeground uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onAbilityForeground uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
},
// 当UIAbility从前台转到后台时触发回调
onAbilityBackground
(
uiAbility
)
{
console
.
log
(
TAG
,
`onAbilityBackground uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onAbilityBackground uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
},
// 当UIAbility迁移时被调用
onAbilityContinue
(
uiAbility
)
{
console
.
log
(
TAG
,
`onAbilityContinue uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
console
.
info
(
TAG
,
`onAbilityContinue uiAbility.launchWant:
${
JSON
.
stringify
(
uiAbility
.
launchWant
)}
`
);
}
}
// 获取应用上下文
let
applicationContext
=
this
.
context
.
getApplicationContext
();
// 注册应用内生命周期回调
this
.
lifecycleId
=
applicationContext
.
on
(
'
abilityLifecycle
'
,
abilityLifecycleCallback
);
console
.
log
(
TAG
,
`register callback number:
${
this
.
lifecycleId
}
`
);
console
.
info
(
TAG
,
`register callback number:
${
this
.
lifecycleId
}
`
);
}
...
...
...
zh-cn/application-dev/application-models/arkts-ui-widget-event-uiability.md
浏览文件 @
1464c319
...
...
@@ -180,7 +180,7 @@
// 监听call事件所需的方法
this
.
callee
.
on
(
MSG_SEND_METHOD
,
FunACall
);
}
catch
(
error
)
{
console
.
log
(
`
${
MSG_SEND_METHOD
}
register failed with error
${
JSON
.
stringify
(
error
)}
`
)
console
.
info
(
`
${
MSG_SEND_METHOD
}
register failed with error
${
JSON
.
stringify
(
error
)}
`
)
}
}
...
...
...
zh-cn/application-dev/application-models/common-event-static-subscription.md
浏览文件 @
1464c319
...
...
@@ -15,7 +15,7 @@
export
default
class
StaticSubscriber
extends
StaticSubscriberExtensionAbility
{
onReceiveEvent
(
event
)
{
console
.
log
(
'
onReceiveEvent, event:
'
+
event
.
event
);
console
.
info
(
'
onReceiveEvent, event:
'
+
event
.
event
);
}
}
```
...
...
zh-cn/application-dev/application-models/hop-multi-device-collaboration.md
浏览文件 @
1464c319
...
...
@@ -439,10 +439,10 @@
// 注册caller的协同场景下跨设备组件状态变化监听通知
try {
caller.onRemoteStateChange((str) => {
console.
log
('Remote state changed ' + str);
console.
info
('Remote state changed ' + str);
});
} catch (error) {
console.
log
('Caller.onRemoteStateChange catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
console.
info
('Caller.onRemoteStateChange catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}');
}
}
}).catch((error) => {
...
...
zh-cn/application-dev/application-models/inputmethodextentionability.md
浏览文件 @
1464c319
...
...
@@ -66,7 +66,7 @@ InputMethodExtensionAbility通过[InputMethodExtensionContext](../reference/apis
}
onDestroy
()
{
console
.
log
(
"
onDestroy.
"
);
console
.
info
(
"
onDestroy.
"
);
this
.
context
.
destroy
();
}
}
...
...
zh-cn/application-dev/application-models/serviceextensionability.md
浏览文件 @
1464c319
...
...
@@ -115,7 +115,7 @@ export default class ServiceExtImpl extends IdlServiceExtStub {
insertDataToMap
(
key
:
string
,
val
:
number
,
callback
:
insertDataToMapCallback
):
void
{
// 开发者自行实现业务逻辑
console
.
log
(
TAG
,
`insertDataToMap, key:
${
key
}
val:
${
val
}
`
);
console
.
info
(
TAG
,
`insertDataToMap, key:
${
key
}
val:
${
val
}
`
);
callback
(
ERR_OK
);
}
}
...
...
@@ -320,10 +320,10 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap
let
serviceExtProxy
=
new
IdlServiceExtProxy
(
remote
);
// 通过接口调用的方式进行通信,屏蔽了RPC通信的细节,简洁明了
serviceExtProxy
.
processData
(
1
,
(
errorCode
,
retVal
)
=>
{
console
.
log
(
`processData, errorCode:
${
errorCode
}
, retVal:
${
retVal
}
`
);
console
.
info
(
`processData, errorCode:
${
errorCode
}
, retVal:
${
retVal
}
`
);
});
serviceExtProxy
.
insertDataToMap
(
'
theKey
'
,
1
,
(
errorCode
)
=>
{
console
.
log
(
`insertDataToMap, errorCode:
${
errorCode
}
`
);
console
.
info
(
`insertDataToMap, errorCode:
${
errorCode
}
`
);
})
},
onDisconnect
(
elementName
)
{
...
...
@@ -415,7 +415,7 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap
insertDataToMap
(
key
:
string
,
val
:
number
,
callback
:
insertDataToMapCallback
):
void
{
// 开发者自行实现业务逻辑
console
.
log
(
TAG
,
`insertDataToMap, key:
${
key
}
val:
${
val
}
`
);
console
.
info
(
TAG
,
`insertDataToMap, key:
${
key
}
val:
${
val
}
`
);
callback
(
ERR_OK
);
}
}
...
...
@@ -455,7 +455,7 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap
insertDataToMap
(
key
:
string
,
val
:
number
,
callback
:
insertDataToMapCallback
):
void
{
// 开发者自行实现业务逻辑
console
.
log
(
TAG
,
`insertDataToMap, key:
${
key
}
val:
${
val
}
`
);
console
.
info
(
TAG
,
`insertDataToMap, key:
${
key
}
val:
${
val
}
`
);
callback
(
ERR_OK
);
}
}
...
...
zh-cn/application-dev/application-models/windowextensionability.md
浏览文件 @
1464c319
...
...
@@ -43,7 +43,7 @@ WindowExtensionAbility提供了onConnect()、onDisconnect()和onWindowReady()生
onWindowReady
(
window
)
{
window
.
loadContent
(
'
WindowExtAbility/pages/index1
'
).
then
(()
=>
{
window
.
getProperties
().
then
((
pro
)
=>
{
console
.
log
(
"
WindowExtension
"
+
JSON
.
stringify
(
pro
));
console
.
info
(
"
WindowExtension
"
+
JSON
.
stringify
(
pro
));
})
window
.
show
();
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录