1# Setting the Icon and Name of a Mission Snapshot 2 3Setting a unique icon and name for each mission snapshot of an application helps you better manage the missions and functions of the application. 4 5By default, the **icon** and **label** fields in the [abilities tag](../quick-start/module-configuration-file.md#abilities) of the [module.json5 file](../quick-start/module-configuration-file.md) are used to set the icon and label. 6 7Figure 1 Mission snapshot of a UIAbility 8 9 10 11You can also use [UIAbilityContext.setMissionIcon()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionicon) and [UIAbilityContext.setMissionLabel()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionlabel) to customize the icon and name for a mission snapshot. For example, for a UIAbility instance in multiton mode, you can configure the icon and name for each mission snapshot based on different functions. 12 13This document describes the following operations: 14 15- [Setting a Mission Snapshot Icon (for System Applications Only)](#setting-a-mission-snapshot-icon-for-system-applications-only) 16- [Setting a Mission Snapshot Name](#setting-a-mission-snapshot-name) 17 18## Setting a Mission Snapshot Icon (for System Applications Only) 19 20Call [UIAbilityContext.setMissionIcon()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionicon) to set the icon of a mission snapshot. For details about how to obtain the context, see [Obtaining the Context of UIAbility](uiability-usage.md#obtaining-the-context-of-uiability). For details about how to obtain the PixelMap information in the example, see [Image Decoding](../media/image-decoding.md). 21 22```ts 23import common from '@ohos.app.ability.common'; 24 25let context: common.UIAbilityContext = ...; // UIAbilityContext 26let pixelMap: PixelMap =...; // PixelMap information of the image. 27 28context.setMissionIcon(pixelMap, (err) => { 29 if (err.code) { 30 console.error(`Failed to set mission icon. Code is ${err.code}, message is ${err.message}`); 31 } 32}) 33``` 34 35The display effect is shown below. 36 37Figure 2 Mission snapshot icon 38 39 40 41## Setting a Mission Snapshot Name 42 43Call [UIAbilityContext.setMissionLabel()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissionlabel) to set the name of a mission snapshot. 44 45```ts 46import common from '@ohos.app.ability.common'; 47import { BusinessError } from '@ohos.base'; 48 49let context: common.UIAbilityContext = this.context; // UIAbilityContext 50 51context.setMissionLabel('test').then(() => { 52 console.info('Succeeded in seting mission label.'); 53}).catch((err: BusinessError) => { 54 console.error(`Failed to set mission label. Code is ${err.code}, message is ${err.message}`); 55}); 56``` 57 58The display effect is shown below. 59 60Figure 3 Mission snapshot name 61 62