#鸿蒙学习大百科#如何通过隐式Want打开网址?

如何通过隐式Want打开网址?

HarmonyOS
2024-10-22 15:12:47
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
后知后觉cy
let context = getContext(this) as common.UIAbilityContext;
let wantInfo: Want = {
  // uncomment line below if wish to implicitly query only in the specific bundle.
  // bundleName: 'com.example.myapplication',
  action: 'ohos.want.action.viewData',
  // entities can be omitted.
  entities: ['entity.system.browsable'],
  uri: 'https://www.test.com:8080/query/student'
}
context.startAbility(wantInfo).then(() => {
  // ...
}).catch((err: BusinessError) => {
  // ...
})
分享
微博
QQ
微信
回复
2024-10-22 22:35:15
相关问题
#鸿蒙学习大百科#什么是Want
209浏览 • 1回复 待解决