提交 bb125569 编写于 作者: G Gloria

Update docs against 16863

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 c7900e92
......@@ -59,6 +59,7 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
```
Import the **WorkSchedulerExtensionAbility** module.
```js
import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility';
```
......@@ -78,7 +79,6 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
}
```
3. Start a Work Scheduler task.
```ts
......@@ -106,7 +106,6 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
}
```
4. Stop the Work Scheduler task.
```ts
......@@ -132,10 +131,8 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
} catch (error) {
console.error(`workschedulerLog stopWork failed. code is ${error.code} message is ${error.message}`);
}
```
5. Obtain a specified Work Scheduler task.
```ts
......@@ -187,7 +184,7 @@ onWorkStop(work: WorkInfo): void | Called when the Work Scheduler task stops.
try{
workScheduler.isLastWorkTimeOut(500, (error, res) =>{
if (error) {
onsole.error(`workschedulerLog isLastWorkTimeOut failed. code is ${error.code} message is ${error.message}`);
console.error(`workschedulerLog isLastWorkTimeOut failed. code is ${error.code} message is ${error.message}`);
} else {
console.info(`workschedulerLog isLastWorkTimeOut success, data is: ${res}`);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册