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

网站做的一样算侵权吗站群建站系统

网站做的一样算侵权吗,站群建站系统,个人网站 怎么设计,网站搭建系统都有哪些android某个功能和应用快捷方式 最近接受到一个任务#xff0c;给应用内的一个功能点创建一个快捷方式#xff0c;方便用户操作快捷、 一#xff0c;第一种方式#xff0c;只适用Build.VERSION.SDK_INT25 以上的版本 /** shortcutId 快捷方式的标示#xff0c;自己定…android某个功能和应用快捷方式 最近接受到一个任务给应用内的一个功能点创建一个快捷方式方便用户操作快捷、 一第一种方式只适用Build.VERSION.SDK_INT25 以上的版本 /** shortcutId 快捷方式的标示自己定义 * 固定快捷方式* Build.VERSION.SDK_INT25以上*/private fun createQuestPinShortcut(context: Context) {if (Build.VERSION.SDK_INT Build.VERSION_CODES.N_MR1) {if (mShortcutManager null) {mShortcutManager context.getSystemService(ShortcutManager::class.java)}var isExit falsemShortcutManager?.pinnedShortcuts?.forEach {if (shortcutId it.id) {//判断快捷方式是否已存在isExit trueToast.showToast(context, 快捷方式已存在)returnforEach}}if (mShortcutManager?.isRequestPinShortcutSupported true !isExit) {val intent Intent(context, ShortcutAlarmCallActivity::class.java)intent.action shortcutActionintent.action Intent.ACTION_VIEWval pinShortcutInfo ShortcutInfo.Builder(context, shortcutId).setShortLabel(context.getString(R.string.shortcut_alarm_long)).setLongLabel(context.getString(R.string.shortcut_alarm_long)).setIcon(Icon.createWithResource(context, R.mipmap.icon_alarm_emergency)).setIntent(intent).build()// 注册固定快捷方式成功广播val intentFilter IntentFilter()intentFilter.addAction(shortcutBroadcast)val receiver ShoutCutReceiver()context.registerReceiver(receiver, intentFilter)val flag PendingIntent.FLAG_IMMUTABLE or FLAG_UPDATE_CURRENTval pinnedShortcutCallbackIntent Intent(shortcutBroadcast)val successCallback PendingIntent.getBroadcast(context,0,pinnedShortcutCallbackIntent,flag)mShortcutManager?.requestPinShortcut(pinShortcutInfo, successCallback.intentSender)}}}二、第二种方式 适配android 8以下的版本和以上的版本 /*** 兼容创建快捷方式* param context Context*/open fun addShortCutCompact(context: Context) {if (isShortCutExist(context, context.getString(R.string.shortcut_alarm_long))) {Toast.showToast(context, 快捷方式已存在)return}if (!ShortcutManagerCompat.isRequestPinShortcutSupported(context)) {Toast.showToast(context, 无法创建快捷方式)return}val shortcutInfoIntent Intent()shortcutInfoIntent.setClassName(context, className)shortcutInfoIntent.action Intent.ACTION_VIEW //action必须设置不然报错val info ShortcutInfoCompat.Builder(context, shortcutId).setIcon(IconCompat.createWithResource(context, R.mipmap.icon_alarm_emergency)).setShortLabel(context.getString(R.string.shortcut_alarm_long)).setIntent(shortcutInfoIntent).build()// 注册固定快捷方式成功广播val intentFilter IntentFilter()intentFilter.addAction(shortcutBroadcast)val receiver ShoutCutReceiver()context.registerReceiver(receiver, intentFilter)val pinnedShortcutCallbackIntent Intent(shortcutBroadcast)val flag PendingIntent.FLAG_IMMUTABLE or FLAG_UPDATE_CURRENT//当添加快捷方式的确认弹框弹出来时将被回调val shortcutCallbackIntent PendingIntent.getBroadcast(context,0,pinnedShortcutCallbackIntent,if (Build.VERSION.SDK_INT Build.VERSION_CODES.S) flag else 0)ShortcutManagerCompat.requestPinShortcut(context,info,null)}三、用第二种方式可以用以下方法判断是否存在快捷方式 /*** 判断是否存在快捷方式* param context Context* return Boolean*/private fun isShortCutExist(context: Context, title: String): Boolean {var isInstallShortcut falseif (TextUtils.isEmpty(title)) {return false}val contentResolver: ContentResolver context.contentResolvertry {val authority com.android.launcher3.settingsval url content://$authority/favorites?notifytrueval contentUrl: Uri Uri.parse(url)val strArray arrayOf(title, iconResource)val cursor: Cursor? contentResolver.query(contentUrl, strArray, title?,arrayOf(title.trim()), null)cursor?.let {if (it.count 0) {isInstallShortcut true}if (!it.isClosed) {it.close()}}} catch (e: Exception) {e.toString()}return isInstallShortcut}****## 最近要记得添加权限****kotlin!-- 添加快捷方式 --uses-permission android:namecom.android.launcher.permission.INSTALL_SHORTCUT /!-- 移除快捷方式 --uses-permission android:namecom.android.launcher.permission.UNINSTALL_SHORTCUT /!-- 查询快捷方式4.4以上 --uses-permission android:namecom.android.launcher3.permission.READ_SETTINGS /uses-permission android:namecom.android.launcher3.permission.WRITE_SETTINGS /如果要添加创建成功提示 class ShoutCutReceiver: BroadcastReceiver() {override fun onReceive(context: Context, intent: Intent) {Log.i(ShoutCutReceiver, onReceive: 创建成功)Toast.showToast(context, R.drawable.icon_succes_tip,创建成功)} }
http://www.zqtcl.cn/news/581441/

相关文章:

  • 骨干专业建设验收网站xueui wordpress
  • 宁波高质量品牌网站设计厂家世界上有php应用的网站
  • 网站平台建设的重要性响应式网站切图
  • 近期做网站需要什么软件网站制作常见的问题
  • vs做的本地网站甘肃省建设厅门户网站
  • 网站建设合同义务wordpress m1
  • 青海省建设局网站首页wordpress模板建站教程视频
  • 演示 又一个wordpress站点静态页面加wordpress
  • 企业做淘宝客网站有哪些有网站吗给一个
  • 深圳网站制作公司信息之梦与wordpress哪个好用
  • 免费搭建商城网站山西制作网站公司排名
  • 网站开发免费中建建设银行网站
  • 301重定向到新网站在线建站
  • 曰本做爰l网站沙朗做网站公司
  • 广州网站设计智能 乐云践新专家wordpress 头像设置
  • 电子商务学网站建设好吗佛山市手机网站建设企业
  • 为企业做网站电话开场白小说网站的里面的搜索是怎么做的
  • 深圳市设计网站公司自己做网站开网店
  • 智能建站cms管理系统修改wordpress时区
  • 站长怎么添加网站内容重庆网站推
  • 东莞网站建设属于什么专业网页设计代码书
  • 网站后台代码在哪修改wordpress添加搜索小工具
  • 爱站站长工具中国建设监理协会官方网站
  • 珠海微信网站开发东莞网站制作方案定制
  • 大学网站建设说明书记的网站域名
  • 网站如何开通支付功能第一ppt课件免费下载官网
  • 做1元夺宝网站挣钱吗美工网站设计收费
  • 华侨城网站开发wordpress页码颜色
  • 上海建站网络公司制作文字图片
  • 平台型网站制作网站建设张世勇