提交 804680e6 编写于 作者: L liminjie10

fixed 42c507fe from https://gitee.com/liminjie10/docs/pulls/14426

蓝区master:修改setValue接口的示例代码
Signed-off-by: Nliminjie10 <liminjie10@huawei.com>
上级 30d79c6d
......@@ -328,6 +328,8 @@ import featureAbility from '@ohos.ability.featureAbility';
//更新数据项亮度的值(该数据项在数据库中已存在,故setValue方法将更新该数据项的值)
let uri = settings.getUriSync(settings.display.SCREEN_BRIGHTNESS_STATUS);
let helper = featureAbility.acquireDataAbilityHelper(uri);
//@ts-ignore
//此处数据项值的类型为string
settings.setValue(helper, settings.display.SCREEN_BRIGHTNESS_STATUS, '100', (status) => {
console.log('Callback return whether value is set.');
});
......@@ -365,6 +367,8 @@ import featureAbility from '@ohos.ability.featureAbility';
//更新数据项亮度的值(该数据项在数据库中已存在,故setValue方法将更新该数据项的值)
let uri = settings.getUriSync(settings.display.SCREEN_BRIGHTNESS_STATUS);
let helper = featureAbility.acquireDataAbilityHelper(uri);
//@ts-ignore
//此处数据项值的类型为string
settings.setValue(helper, settings.display.SCREEN_BRIGHTNESS_STATUS, '100').then((status) => {
console.log('Callback return whether value is set.');
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册