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

黑彩网站建设运营seo相关岗位

黑彩网站建设运营,seo相关岗位,中国建设银行app登录密码忘记了,网站权重问题文章目录一、背景二、app发起分享1. 通过分享面板进行分享2. 使用其他应用打开二、处理分享的内容1. module.json5 配置可接收分享2. 解析分享的数据一、背景 在App开发中#xff0c;分享是常用功能#xff0c;这里介绍鸿蒙开发中#xff0c;其他应用分享到自己的app中module.json5 配置可接收分享2. 解析分享的数据一、背景 在App开发中分享是常用功能这里介绍鸿蒙开发中其他应用分享到自己的app中或者自己的app分享给其他app 鸿蒙系统分享地址 二、app发起分享 1. 通过分享面板进行分享 导入相关模块。 import { common } from kit.AbilityKit; import { systemShare } from kit.ShareKit; import { uniformTypeDescriptor as utd } from kit.ArkData;获取统一数据类型 可以自己确定分享的类型也可以调用方法通过后缀获取分享类型 getUniformDataTypeByFilenameExtension let utdTypeId if (file.extension.length 0) {utdTypeId utd.UniformDataType.FOLDER} else {utdTypeId utd.getUniformDataTypeByFilenameExtension(file.extension, utd.UniformDataType.OBJECT);}if (utdTypeId.length 0) {promptAction.showToast({message: appUtils.getResString(share_tip2)})return}构造分享数据可添加多条分享记录。 let shareData: systemShare.SharedData new systemShare.SharedData({utd: utdTypeId,uri: file.uri});启动分享面板时配置分享面板显示的位置信息或关联的组件ID面板将以Popup形式展示。 let controller: systemShare.ShareController new systemShare.ShareController(shareData);// 获取UIAbility上下文对象let context: common.UIAbilityContext getContext(this) as common.UIAbilityContext;// 进行分享面板显示controller.show(context, {previewMode: systemShare.SharePreviewMode.DEFAULT,selectionMode: systemShare.SelectionMode.SINGLE});2. 使用其他应用打开 通过context调用startAbility弹出系统弹窗使用其他应用打开文件 // Construct request data Want, taking opening a Word file as an examplelet wantInfo: Want {uri: file.uri, // Indicate the URI path of the file to be opened, usually used in conjunction with typetype: application/msword, // Indicate the type of file to be openedflags: wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION, // Authorization to perform write operations on URI}// Call the startAbility interface to open fileslet context getContext(this) as common.UIAbilityContext;context.startAbility(wantInfo).then(() {console.info(分享成功);}).catch((err: BusinessError) {console.info(分享失败);})二、处理分享的内容 1. module.json5 配置可接收分享 在module.json5 下找到 abilities标签找到 skills 配置entities添加 entity.system.share entities: [entity.system.home,entity.system.share],配置actions,添加actions actions: [action.system.home,ohos.want.action.select,ohos.want.action.sendData,ohos.want.action.viewData // 必填声明数据处理能力],配置uris uris: [{scheme: file,// 物理存储类型的基类型utd: general.entity,maxFileSupported: 1,linkFeature: FileOpen},{scheme: file,// 逻辑内容类型的基类型utd: general.object,maxFileSupported: 1,linkFeature: FileOpen}]2. 解析分享的数据 在其onCreate或onNewWant回调中获取传入的want参数 onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);// 注入Ability上下文到AppUtilsAppUtils.getInstance().context this.context;hilog.info(DOMAIN, testTag, %{public}s, Ability onCreate);ShareManager.getInstance().handelShareData(want);} onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {ShareManager.getInstance().handelShareData(want)}通过getSharedData 解析分享数据 /** 处理分享过来的文件 */public handelShareData(want: Want) {systemShare.getSharedData(want).then((data: systemShare.SharedData) {data.getRecords().forEach((record: systemShare.SharedRecord) {// 处理分享数据});}).catch((error: BusinessError) {DKLogger.error(Failed to getSharedData. Code: ${error.code}, message: ${error.message});// this.context.terminateSelf();if (want.action ohos.want.action.sendData|| want.action ohos.want.action.viewData) {}});}处理完分享数据即可将数据在页面显示
http://www.zqtcl.cn/news/487115/

相关文章:

  • 做考试平台的网站网站之前没备案
  • 网站维护要多久时间北京网站优化哪家好
  • 单页推广网站模版网站建设一个购买链接
  • 湖南门户网站设计公司免费自媒体网站
  • 美食网站建设项目预算域名解析站长工具
  • 网站如何备案工信局学网站开发首先学哪些基础
  • 什么网站利于优化河北省建设局网站材料备案
  • 自学装修设计从哪里入手沈阳百度seo
  • 做jsp网站用哪些软件下载如何利用网站赚钱
  • 注册网站域名需要什么湘潭公司做网站
  • 一个网站如何优化企业资质查询平台
  • 模板网站为什么做不了优化山西网络网站建设销售公司
  • 建设什么网站可以赚钱设计本网站是用什么做的
  • 荆州市网站建设策划师
  • 苏州中国建设银行招聘信息网站中国企业登记网
  • 网站服务器的重要性新闻软文范例大全
  • 茶叶网站建设一般的风格加大志愿服务网站建设
  • 湖州医院网站建设方案网页游戏知乎
  • 以网站建设为开题报告临海门户网站住房和城乡建设规划局
  • 河南省大型项目建设办公室网站wordpress置顶功能
  • 奉化网站建设三合一网站建设多少钱
  • wordpress文章页怎么调用网站图片wordpress菜单锚点定位
  • 网站建设运营合作合同网站建设英文合同
  • wordpress chrome插件开发图片式网站利于做优化吗
  • 如何做好品牌网站建设策划app要有网站做基础
  • 横沥网站建设公司wordpress运行php
  • 南皮网站建设价格网络推广这个工作好做吗
  • 长安大学门户网站是谁给做的网站排名logo怎么做
  • 襄樊做网站做网站做网站
  • 百度做网站续费费用网站开发的可行性