diff --git a/commons/base/src/main/ets/utils/WindowUtil.ets b/commons/base/src/main/ets/utils/WindowUtil.ets index a050a95fca4bf96919db92c3aa0ff0b68e894523..3d06f4357cb751bfb45859d7104f3ad6a25463c2 100644 --- a/commons/base/src/main/ets/utils/WindowUtil.ets +++ b/commons/base/src/main/ets/utils/WindowUtil.ets @@ -64,12 +64,10 @@ export class WindowUtil { return; } // Set full-screen display. - this.mainWindowClass.setWindowLayoutFullScreen(true, (err) => { - if (err.code) { - Logger.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err)); - return; - } + this.mainWindowClass.setWindowLayoutFullScreen(true).then(() => { Logger.info('Succeeded in setting the window layout to full-screen mode.'); + }).catch((error: BusinessError) => { + Logger.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(error)); }); }