| | |
| | | import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit'; |
| | | import { hilog } from '@kit.PerformanceAnalysisKit'; |
| | | import { window } from '@kit.ArkUI'; |
| | | import PreferencesUtils from '../utils/PreferencesUtils'; |
| | | |
| | | const DOMAIN = 0x0000; |
| | | |
| | |
| | | onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { |
| | | this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); |
| | | hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onCreate'); |
| | | |
| | | PreferencesUtils.loadPreferences(this.context,'UserInfo') |
| | | } |
| | | |
| | | onDestroy(): void { |
| | |
| | | // Main window is created, set main page for this ability |
| | | hilog.info(DOMAIN, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); |
| | | |
| | | windowStage.loadContent('pages/Index', (err) => { |
| | | windowStage.loadContent('pages/StartPage', (err) => { |
| | | if (err.code) { |
| | | hilog.error(DOMAIN, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); |
| | | return; |