提交 77f38a31 编写于 作者: C chengxingzhen

xts-stage模型的requestPermissionsFromUser下库

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 f08c0581
import Ability from '@ohos.app.ability.UIAbility'
import commonEvent from '@ohos.commonEvent';
var printLog10 = "Stage:MainAbility10:";
var listPush10 = "Stage_MainAbility10_";
export default class MainAbility10 extends Ability {
onCreate(want, launchParam) {
console.info(printLog10 + "onCreate")
setTimeout(()=>{
this.context.terminateSelf().then((data) => {
console.info(printLog10 + "terminateSelf data = " + JSON.stringify(data));
}).catch((err) => {
console.info(printLog10 + "terminateSelf err = " + JSON.stringify(err));
});
}, 3000)
}
onDestroy() {
console.info(printLog10 + "onDestroy")
commonEvent.publish(listPush10 + "onDestroy", (err) => {
console.info(printLog10 + listPush10 + "onDestroy");
});
}
onWindowStageCreate(windowStage) {
// Main window is created, set main page for this ability
console.info(printLog10 + "onWindowStageCreate")
windowStage.setUIContent(this.context, "pages/index", null)
}
onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
console.info(printLog10 + "onWindowStageDestroy")
}
onForeground() {
// Ability has brought to foreground
console.info(printLog10 + "onForeground")
}
onBackground() {
// Ability has back to background
console.info(printLog10 + "onBackground")
}
};
......@@ -78,17 +78,6 @@
"startWindowBackground": "$color:white",
"visible": true,
"launchType": "singleton"
},
{
"name": "MainAbility10",
"srcEntrance": "./ets/MainAbility10/MainAbility10.ts",
"description": "$string:MainAbility10_desc",
"icon": "$media:icon",
"label": "$string:MainAbility10_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:white",
"visible": true,
"launchType": "singleton"
}
],
"requestPermissions": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册