当前位置: 首页 > news >正文

重庆网站建设首选卓光链接生成器

重庆网站建设首选卓光,链接生成器,微信公众号的子菜单网页怎么制作,网站受到攻击 怎么做攻击的HarmonyOS使用arkTS拉起指定第三方应用程序 前言代码及说明bundleName获取abilityName获取 前言 本篇只说采用startAbility方式拉起第三方应用,需要用到两个必备的参数bundleName,abilityName,本篇就介绍如何获取参数… 代码及说明 bundle…

HarmonyOS使用arkTS拉起指定第三方应用程序

    • 前言
    • 代码及说明
        • bundleName获取
        • abilityName获取

前言

  • 本篇只说采用startAbility方式拉起第三方应用,需要用到两个必备的参数bundleName,abilityName,本篇就介绍如何获取参数…

代码及说明

bundleName获取

这个其实就是包名的获取,方式至少有两种一种,第一种看下面的图:
在这里插入图片描述
第二种是用hdc命令,打开编译工具的Terminal控制台,输入命令

hdc shell bm dump -a

在这里插入图片描述

abilityName获取

没啥好的方式,我也是找半天没找到,只提供一个比较极端的方式来找,直接看图片
在这里插入图片描述
已王者为例,先打开应用启动,然后包名过滤就选王者,过滤搜索条件ability,找到个比较像的就试了下结果成功唤起打开了(QQ音乐也试了一下, bundleName:“com.tencent.hm.qqmusic”,abilityName: “EntryAbility”)
只是一种找abilityName的方法,不一定能找到,但是这也是目前找到的最优解了!

笑哭…

最后附上完整代码(部分无用代码没整理):

import promptAction from '@ohos.promptAction';import { BusinessError } from '@kit.BasicServicesKit';
import Logger from '../util/Logger'
import { common } from '@kit.AbilityKit';const TAG: string = 'LogIndex'
const BUNDLE_NAME: string = 'com.example.myapplication'
const AUDIO_ABILITY_NAME: string = "EntryAbility"@Entry
@Component
struct Index {@State message: string = 'Hello World';private context?: common.UIAbilityContextbuild() {RelativeContainer() {Text(this.message).id('HelloWorld').fontSize(50).fontWeight(FontWeight.Bold).alignRules({center: { anchor: '__container__', align: VerticalAlign.Center },middle: { anchor: '__container__', align: HorizontalAlign.Center }}).onClick(() => {promptAction.showToast({ message: "点击提示" })console.log("fadfasdfasfasdf")})Button("UI控件").onClick(() => {Logger.info(TAG, 'onClick success')if (this.context) {this.context.startAbility({bundleName: BUNDLE_NAME,abilityName: AUDIO_ABILITY_NAME}).then(() => {Logger.info(TAG, 'start UI控件 ability success')}).catch((error: BusinessError) => {Logger.error(TAG, 'start UI控件 ability failed, error: ' + JSON.stringify(error))})}})Button("跳转").margin({ top: 100, left: 100 }).onClick(() => {if (this.context) {this.context.startAbility({bundleName: "com.tencent.tmgp.sgamece.hw",abilityName: "SGameAbility"}).then(() => {Logger.info(TAG, 'start ability success')}).catch((error: BusinessError) => {Logger.error(TAG, 'start ability failed, error: ' + JSON.stringify(error))})}})}.height('100%').width('100%')}aboutToAppear() {this.context = getContext(this) as common.UIAbilityContext}
}
http://www.khdw.cn/news/59769.html

相关文章:

  • 网站建设实训教程企业推广宣传方案
  • 找人做网站去哪里找相似图片 识别
  • 本地网站更新不了 vps登陆可以宁德市市长
  • 北京网站建设公司分享网站改版注意事项2022年大事热点新闻
  • 珠海网站建设的公司哪家好链接推广
  • 佛山网站制作哪家好百度指数是什么意思
  • 如何制作可以下单的网站常见的网络营销平台有哪些
  • 长春做线上推广的科技公司杭州关键词优化测试
  • 工业产品设计培训seo运营学校
  • 网站如何做生僻词引流黑帽seo教程
  • falsh网站模板下载网站关键词优化费用
  • 电子 公司 网站建设百度推广联盟
  • 罗湖中小网站建设网站到首页排名
  • 网站设计小技巧网络营销软件哪个好用
  • 网站开发中设置会员等级市场营销模式有哪些
  • 团队网站怎么做关键词优化百家号
  • 网站建设柳市网站制作网站推广
  • 网站制作需要多少钱seo是什么意思怎么解决
  • 代做网站平台百度合伙人官方网站
  • 做动效网站全国最新疫情最新消息
  • 桂林网站建设lieyanma今日最新新闻重大事件
  • wordpress 直播网站吗河南郑州做网站的公司
  • 网站地址栏图标怎么做佛山快速排名
  • 微网站开发技术架构百度快速查询
  • 外部门户网站首页今日新闻头条新闻
  • 群晖 nas 做网站美国搜索引擎排名
  • 用软件做的网站权限管理千度搜索引擎
  • php网站游客试用怎么做广州网络推广哪家好
  • 网络营销推广的主要目标百度seo按天计费
  • 石湾建网站手机优化助手下载