harmony(鸿蒙)MissionSnapshot

  • 2022-08-09
  • 浏览 (709)

MissionSnapshot

The MissionSnapshot module provides the mission snapshot information of an ability.

NOTE

The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. The APIs of this module are system APIs and cannot be called by third-party applications.

Usage

The mission snapshot information can be obtained by using getMissionSnapShot in missionManager.

import ElementName from '@ohos.bundle';
import image from '@ohos.multimedia.image';
import missionManager from '@ohos.application.missionManager';

missionManager.getMissionInfos("", 10, (error, missions) => {
  console.log("getMissionInfos is called, error.code = " + error.code);
  console.log("size = " + missions.length);
  console.log("missions = " + JSON.stringify(missions));
  var id = missions[0].missionId;

  missionManager.getMissionSnapShot("", id, (error, snapshot) => {
    console.log("getMissionSnapShot is called, error.code = " + error.code);
    console.log("bundleName = " + snapshot.ability.bundleName);
  })
})

MissionSnapshot

Describes the mission snapshot.

System capability: SystemCapability.Ability.AbilityRuntime.Mission

Name Type Readable Writable Description
ability ElementName Yes Yes Information that matches an ability.
snapshot image.PixelMap Yes Yes Snapshot of the mission.

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)APIs

harmony(鸿蒙)API Reference Document Description

harmony(鸿蒙)BundleStatusCallback

harmony(鸿蒙)innerBundleManager(deprecated)

harmony(鸿蒙)distributedBundle

harmony(鸿蒙)Bundle

harmony(鸿蒙)Context

harmony(鸿蒙)DataUriUtils

harmony(鸿蒙)EnterpriseAdminExtensionAbility

harmony(鸿蒙)Work Scheduler Callbacks

0  赞