1import UIAbility from "@ohos:app.ability.UIAbility"; 2 3import hilog from "@ohos:hilog"; 4 5export default class EntryAbility extends UIAbility { 6 onCreate(o, i) { 7 hilog.info(0, "testTag", "%{public}s", "Ability onCreate"); 8 } 9 onDestroy() { 10 hilog.info(0, "testTag", "%{public}s", "Ability onDestroy"); 11 } 12 onWindowStageCreate(o) { 13 hilog.info(0, "testTag", "%{public}s", "Ability onWindowStageCreate"); 14 o.loadContent("pages/Index", ((o, i) => { 15 var t, e; 16 o.code ? hilog.error(0, "testTag", "Failed to load the content. Cause: %{public}s", null !== (t = JSON.stringify(o)) && void 0 !== t ? t : "") : hilog.info(0, "testTag", "Succeeded in loading the content. Data: %{public}s", null !== (e = JSON.stringify(i)) && void 0 !== e ? e : ""); 17 })); 18 } 19 onWindowStageDestroy() { 20 hilog.info(0, "testTag", "%{public}s", "Ability onWindowStageDestroy"); 21 } 22 onForeground() { 23 hilog.info(0, "testTag", "%{public}s", "Ability onForeground"); 24 } 25 onBackground() { 26 hilog.info(0, "testTag", "%{public}s", "Ability onBackground"); 27 } 28}