提交 8a1f1465 编写于 作者: W wangkai

9-13

Signed-off-by: Nwangkai <wangkai424@huawei.com>
上级 3bf238ca
......@@ -72,7 +72,6 @@ FA模型下的示例:
```js
import featureAbility from '@ohos.ability.featureAbility'
let kvManager;
console.log("MyAbilityStage onCreate")
let context = featureAbility.getContext()
const kvManagerConfig = {
context: context,
......@@ -130,7 +129,12 @@ export default class MyAbilityStage extends AbilityStage {
userType: distributedData.UserType.SAME_USER_ID
}
}
distributedData.createKVManager(kvManagerConfig);
distributedData.createKVManager(kvManagerConfig).then((manager) => {
console.log("Succeeded in creating KVManager");
kvManager = manager;
}).catch((err) => {
console.log("Failed to create KVManager: " + JSON.stringify(err));
});
}
}
```
......@@ -139,7 +143,6 @@ FA模型下的示例:
```js
import featureAbility from '@ohos.ability.featureAbility'
let kvManager;
console.log("MyAbilityStage onCreate")
let context = featureAbility.getContext()
const kvManagerConfig = {
context: context,
......@@ -149,7 +152,12 @@ const kvManagerConfig = {
userType: distributedData.UserType.SAME_USER_ID
}
}
distributedData.createKVManager(kvManagerConfig);
distributedData.createKVManager(kvManagerConfig).then((manager) => {
console.log("Succeeded in creating KVManager");
kvManager = manager;
}).catch((err) => {
console.log("Failed to create KVManager: " + JSON.stringify(err));
});
```
## KVManagerConfig
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册