@@ -33,8 +33,8 @@ Sets the media query criteria and returns the corresponding listening handle.
| MediaQueryListener | Listening handle to a media event, which is used to register or unregister the listening callback.|
- Example
```
listener = mediaquery.matchMediaSync('(orientation: landscape)'); // Listen for landscape events.
```js
letlistener=mediaquery.matchMediaSync('(orientation: landscape)');// Listen for landscape events.
```
...
...
@@ -79,10 +79,10 @@ Unregisters a callback with the corresponding query condition by using the handl
| callback | Callback<MediaQueryResult> | No| Callback to be unregistered. If the default value is used, all callbacks of the handle are unregistered.|
- Example
```
```js
importmediaqueryfrom'@ohos.mediaquery'
listener = mediaquery.matchMediaSync('(orientation: landscape)'); // Listen for landscape events.
letlistener=mediaquery.matchMediaSync('(orientation: landscape)');// Listen for landscape events.
functiononPortrait(mediaQueryResult){
if(mediaQueryResult.matches){
// do something here
...
...
@@ -90,8 +90,8 @@ Unregisters a callback with the corresponding query condition by using the handl