提交 57eb3a67 编写于 作者: Z zhangxin_T

bugfix

Signed-off-by: Nzhangxin_T <zhangxin312@huawei.com>
上级 f76e5c52
...@@ -140,7 +140,7 @@ ohos.permission.KEEP_BACKGROUND_RUNNING ...@@ -140,7 +140,7 @@ ohos.permission.KEEP_BACKGROUND_RUNNING
} }
``` ```
2. 申请长时任务 2. 申请长时任务
```js ```js
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
...@@ -170,7 +170,7 @@ ohos.permission.KEEP_BACKGROUND_RUNNING ...@@ -170,7 +170,7 @@ ohos.permission.KEEP_BACKGROUND_RUNNING
}); });
``` ```
3. 停止长时任务 3. 停止长时任务
```js ```js
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
...@@ -206,9 +206,9 @@ ohos.permission.KEEP_BACKGROUND_RUNNING ...@@ -206,9 +206,9 @@ ohos.permission.KEEP_BACKGROUND_RUNNING
} }
``` ```
2. 申请长时任务 2. 申请长时任务
```js ```ts
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
import wantAgent from '@ohos.wantAgent'; import wantAgent from '@ohos.wantAgent';
...@@ -235,9 +235,9 @@ ohos.permission.KEEP_BACKGROUND_RUNNING ...@@ -235,9 +235,9 @@ ohos.permission.KEEP_BACKGROUND_RUNNING
}); });
``` ```
3. 停止长时任务 3. 停止长时任务
```js ```ts
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
backgroundTaskManager.stopBackgroundRunning(this.context).then(() => { backgroundTaskManager.stopBackgroundRunning(this.context).then(() => {
...@@ -358,9 +358,9 @@ export default { ...@@ -358,9 +358,9 @@ export default {
基于Stage模型: 基于Stage模型:
Stage模型的相关信息参考[Stage模型综述](../ability/stage-brief.md) Stage模型的相关信息参考[Stage模型综述](../ability/stage-brief.md)
当应用需要在后台执行长时任务时,使Ability在后台被创建并运行。使用方式参考[Call调用开发指导](../ability/stage-call.md) 当应用需要在后台执行长时任务时,可以通过Call的方式在后台创建并运行Ability。使用方式参考[Call调用开发指导](../ability/stage-call.md)
```js ```ts
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import backgroundTaskManager from '@ohos.backgroundTaskManager'; import backgroundTaskManager from '@ohos.backgroundTaskManager';
import wantAgent from '@ohos.wantAgent'; import wantAgent from '@ohos.wantAgent';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册