提交 d540fade 编写于 作者: T tianwenzhe
上级 5bd3328b
......@@ -17,15 +17,15 @@ export default class MainAbility extends Ability {
console.log("[Demo] MainAbility onWindowStageCreate")
let AtManager = abilityAccessCtrl.createAtManager();
AtManager.requestPermissionsFromUser(this.context,["ohos.permission.READ_MEDIA","ohos.permission.WRITE_MEDIA",
"ohos.permission.CAPTURE_SCREEN","ohos.permission.INTERNET","ohos.permission.CAMERA",
"ohos.permission.MICROPHONE", "ohos.permission.START_INVISIBLE_ABILITY"]).then(() => {})
windowStage.loadContent("pages/index", (err, data) => {
AtManager.requestPermissionsFromUser(this.context,['ohos.permission.READ_MEDIA', 'ohos.permission.WRITE_MEDIA',
'ohos.permission.CAPTURE_SCREEN', 'ohos.permission.INTERNET', 'ohos.permission.CAMERA',
'ohos.permission.MICROPHONE', 'ohos.permission.START_INVISIBLE_ABILITY']).then( () => {} );
windowStage.loadContent('pages/index', (err, data) => {
if (err.code) {
console.error('Failed to load the content. Cause:' + JSON.stringify(err));
console.error( 'Failed to load the content. Cause:' + JSON.stringify(err) );
return;
}
console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data))
console.info( 'Succeeded in loading the content. Data: ' + JSON.stringify(data) );
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册