跳转开启我的定位权限页面参考demo:import common from '@ohos.app.ability.common'; import Want from '@ohos.app.ability.Want'; @Entry @Component struct Index6 { @State message: string = 'Hello World'; build() { Row() { Column() { Button("to访问我的位置信息").onClick(()=>{ let context = getContext(this) as common.UIAbilityContext; let want: Want = { bundleName: 'com.example.xxx.settings', abilityName: 'com.example.xxx.settings.MainAbility', uri: "location_manager_settings",//消息通知传uri:systemui_notification_settings, 蓝牙传uri:bluetooth_entry, Wi-Fi传uri:wifi_entry,定位权限传uri:location_manager_settings }; console.log("want",want) context.startAbility(want) }).margin(10) } .width('100%') } .height('100%') } }
跳转开启我的定位权限页面参考demo: