HarmonyOS 打开手机默认浏览器一直报错

打开手机默认浏览器一直报错,error code为 16000019

HarmonyOS
19h前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
zxjiu

从应用内跳转到浏览器并打开网页参考如下demo

import common from '@ohos.app.ability.common';
import Want from '@ohos.app.ability.Want';
import { BusinessError } from '@ohos.base';


let context = getContext(this) as common.UIAbilityContext;
let wantInfo: Want = {
  "action": 'ohos.want.action.viewData',
  "entities": [ 'entity.system.browsable' ],
  "uri": "www.examplesss.com",
}
@Entry
@Component
struct Index27 {
  @State message: string = '跳转网页';
  build() {
    Row() {
      Column() {
        Text(this.message)
          .fontSize(50)
          .fontWeight(FontWeight.Bold)
          .onClick(async ()=>{
            context.startAbility(wantInfo).then(() => {
              // ...
            }).catch((err: BusinessError) => {
              // ...
            })
          })
      }
      .width('100%')
    }
    .height('100%')
  }
}

module.json5文件:

"skills": [
{
  "entities": [
  "entity.system.home",
  "entity.system.browsable"
  ],
  "actions": [
  "action.system.home",
  "ohos.want.action.viewData"
  ],
  "uris": [
  {
    "scheme": "https",
  "host": "www.examplesss.com",
  "port": "8080",
  // prefix matching
  "pathStartWith": "query",
  }
  ]
}
]
分享
微博
QQ
微信
回复
17h前
相关问题
HarmonyOS 启动默认浏览器
595浏览 • 1回复 待解决
HarmonyOS跳转系统浏览器打开网页报错
718浏览 • 1回复 待解决
HarmonyOS IDE无法打开一直崩溃
139浏览 • 1回复 待解决
HarmonyOS 终端运行ohpm一直报错
38浏览 • 1回复 待解决
HarmonyOS获取图片旋转值一直报错
469浏览 • 1回复 待解决