提交 45fd38f0 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 8e8fb729
...@@ -134,7 +134,7 @@ After the callback triggers **appRecovery.saveAppState()**, **onSaveState(state, ...@@ -134,7 +134,7 @@ After the callback triggers **appRecovery.saveAppState()**, **onSaveState(state,
- Restore data. - Restore data.
After the callback triggers **appRecovery.restartApp()**, the application is restarted. After the restart, **onSaveState(state, wantParams)** of **MainAbility** is called, and the saved data is in **parameters** of **want**. After the callback triggers **appRecovery.restartApp()**, the application is restarted. After the restart, **onCreate(want, launchParam)** of **MainAbility** is called, and the saved data is in **parameters** of **want**.
```ts ```ts
storage: LocalStorage storage: LocalStorage
......
...@@ -37,10 +37,10 @@ When an asynchronous callback is used, the return value can be processed directl ...@@ -37,10 +37,10 @@ When an asynchronous callback is used, the return value can be processed directl
## Development Example ## Development Example
```ts ```ts
import Ability from '@ohos.application.Ability' import Ability from '@ohos.application.Ability'
import errorManager from '@ohos.application.errorManager' import errorManager from '@ohos.app.ability.errorManager';
var registerId = -1; let registerId = -1;
var callback = { let callback = {
onUnhandledException: function (errMsg) { onUnhandledException: function (errMsg) {
console.log(errMsg); console.log(errMsg);
} }
...@@ -48,13 +48,13 @@ var callback = { ...@@ -48,13 +48,13 @@ var callback = {
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate") console.log("[Demo] MainAbility onCreate")
registerId = errorManager.registerErrorObserver(callback); registerId = errorManager.on("error", callback);
globalThis.abilityWant = want; globalThis.abilityWant = want;
} }
onDestroy() { onDestroy() {
console.log("[Demo] MainAbility onDestroy") console.log("[Demo] MainAbility onDestroy")
errorManager.unregisterErrorObserver(registerId, (result) => { errorManager.off("error", registerId, (result) => {
console.log("[Demo] result " + result.code + ";" + result.message) console.log("[Demo] result " + result.code + ";" + result.message)
}); });
} }
......
...@@ -50,4 +50,3 @@ Defines attributes of the current locale. ...@@ -50,4 +50,3 @@ Defines attributes of the current locale.
| language | string | Yes | No | Language, for example, **zh**.| | language | string | Yes | No | Language, for example, **zh**.|
| countryOrRegion | string | Yes | No | Country or region, for example, **CN** or **US**.| | countryOrRegion | string | Yes | No | Country or region, for example, **CN** or **US**.|
| dir | string | Yes | No | Text layout direction. The value can be:<br>- **ltr**: from left to right<br>- **rtl**: from right to left| | dir | string | Yes | No | Text layout direction. The value can be:<br>- **ltr**: from left to right<br>- **rtl**: from right to left|
| unicodeSetting<sup>5+</sup> | string | Yes | No | Unicode language key set determined by the locale. If current locale does not have a specific key set, an empty set is returned.<br>For example, **{"nu":"arab"}** indicates that current locale uses Arabic numerals.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册