赞
踩
static async openSystemBrowser(url: string) { if (url) { try { let 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": url, "type": "text/plain" } let context = getContext(this) as common.UIAbilityContext; await context.startAbility(want) console.info(`explicit start ability succeed`) } catch (error) { console.info(`explicit start ability failed with ${error.code}`) } } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。