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

贵港网站建设做直销去哪里找客户

贵港网站建设,做直销去哪里找客户,周村网站建设,wordpress加载视频教程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.fp688.cn/news/833.html

相关文章:

  • 免费推广网站工具app营销十大成功案例
  • 新疆生产建设兵团人社局网站百度自动搜索关键词软件
  • 网站建设如何盈利搜索引擎入口yandex
  • 南宁网站建设费用推广价格一般多少
  • php做网站后台教程企业内训
  • 长春网站开发培训价格搜索风云榜百度
  • 学ps做兼职的网站有哪些免费发布平台
  • 导航网站没有内页没有了windows优化大师自动安装
  • 广东网站建设价格seo快速排名源码
  • 做网站如何网站考虑优化新乡网络推广外包
  • 免费站群系统上海站优云网络科技有限公司
  • 环境设计专业必看网站长沙大型网站建设公司
  • wordpress商品分类标题seo什么是seo是什么意思
  • 站长工具seo综合查询权重专门的网页制作工具有
  • 开封做网站公司郑州seo网络推广
  • 在线医疗网站建设seo外包优化
  • wordpress 订阅号 采集杭州网站推广优化公司
  • 网站空间和数据库的关系腾讯体育nba
  • 推广网站的几种方法小程序源码网
  • 网站建设 盘网互联百度导航是哪个国家的
  • 大型网站建设哪家好灰色词seo排名
  • 批发网站建设平台福州模板建站哪家好
  • 微信借口的网站怎么做中文网站排名
  • html5和html的区别如何网站优化排名
  • 怎么用视频做网站登录的背景/推销产品的万能句子
  • 用什么网站做pathway分析/百度学术官网登录入口
  • 新闻国家大事/如何网站seo
  • 前端如何做双语网站/百度seo整站优化
  • 四川省建行网站/免费html网页模板
  • 建设网站的视频视频/如何免费推广一个网站