提交 8aedbc47 编写于 作者: Z zhangxin_T

bgtask doc bugfix

Signed-off-by: Nzhangxin_T <zhangxin312@huawei.com>
上级 fdc6f10f
......@@ -57,7 +57,7 @@ OpenHarmony提供了九种后台模式,供需要在后台做长时任务的业
| audioRecording | 音频输入 | 正在运行录音任务 | - |
| location | 定位、导航 | 正在运行定位任务 | - |
| bluetoothInteraction | 蓝牙传输 | 正在运行蓝牙相关任务 | - |
| multiDeviceConnection | 分布式互联任务 | 正在运行分布式任务 | - |
| multiDeviceConnection | 应用跨设备多端协同 | 正在运行分布式任务 | - |
| wifiInteraction | WLAN传输 | 正在运行WLAN相关任务 | System API,仅对System权限应用开放 |
| voip | 音视频电话、VOIP | 正在运行通话相关任务 | System API,仅对System权限应用开放 |
| taskKeeping | 计算任务 | 正在运行计算任务 | 仅在特定设备生效 |
......
......@@ -38,7 +38,7 @@
Stage模型的相关信息参考[Stage模型开发概述](../application-models/stage-model-development-overview.md)
1、新建Api Version 9的工程后,在工程目录中右键选择“New” -> “Ability” 快速创建Ability组件。并在module.json5文件中配置长时任务权限ohos.permission.KEEP_BACKGROUND_RUNNING、后台模式类型。
1、在module.json5文件中配置长时任务权限ohos.permission.KEEP_BACKGROUND_RUNNING、同时为需要使用长时任务的ability声明相应的后台模式类型。
```
"module": {
......@@ -295,7 +295,7 @@ export default class BgTaskAbility extends UIAbility {
当需要与后台执行的长时任务交互时(如播放音乐等)。可以采用connectAbility()方法启动并连接Service Ability。在获取到服务的代理对象后,与服务进行通信,控制长时任务的申请和取消。
1、新建Api Version 8的工程后,在工程目录中右键选择“new” -> “Ability” -> “Service Ability” 快速创建Service Ability组件。并在config.json文件中配置长时任务权限ohos.permission.KEEP_BACKGROUND_RUNNING、后台模式类型,其中Ability类型为“service”
1、在config.json文件中配置长时任务权限ohos.permission.KEEP_BACKGROUND_RUNNING、同时为需要使用长时任务的Service Ability声明相应的后台模式类型
```json
"module": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册