uiExtensionAbility组件获焦点

Signed-off-by: li-li-wang <wangliliang5@huawei.com>
This commit is contained in:
li-li-wang 2024-09-24 16:04:22 +08:00
parent aad0029913
commit 3014ddea64
3 changed files with 13 additions and 4 deletions

View File

@ -2,8 +2,8 @@
"app": {
"bundleName": "com.ohos.dlpmanager",
"vendor": "example",
"versionCode": 1000108,
"versionName": "1.0.1.08",
"versionCode": 1000109,
"versionName": "1.0.1.09",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 12,

View File

@ -16,8 +16,8 @@
"app": {
"bundleName": "com.ohos.dlpmanager",
"vendor": "example",
"versionCode": 1000108,
"versionName": "1.0.1.08",
"versionCode": 1000109,
"versionName": "1.0.1.09",
"icon": "$media:app_icon",
"label": "$string:app_name",
"minAPIVersion": 12,

View File

@ -608,6 +608,15 @@ struct encryptedSharing {
'ability.want.params.uiExtensionType': 'sys/commonUI'
}
})
.id('cloudAccountLoginUI')
.onRemoteReady(() => {
try {
HiLog.info(TAG, `requestFocus start`);
this.getUIContext().getFocusController().requestFocus('cloudAccountLoginUI');
} catch (error) {
HiLog.error(TAG, `requestFocus failed. Cause: ${JSON.stringify(error)}`)
}
})
.onReceive((data) => {
HiLog.info(TAG, `data.status: ${JSON.stringify(data.status)}`);
let res = data.result as Record<string, string>;