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

做网站谈单沈阳做网站有名公司

做网站谈单,沈阳做网站有名公司,在哪里可以免费做个人网站,成都房地产市场分析目录 一、通知0. 配置权限1. 测试发送通知代码2. 打开通知设置界面代码3. 前台服务创建常驻通知 二、快捷方式1. 测试添加动态快捷方式代码 三、开发者图块四、桌面小部件 基于jetpack compose 框架的使用代码 一、通知 参见 官方文档 0. 配置权限 uses-permission andr… 目录 一、通知0. 配置权限1. 测试发送通知代码2. 打开通知设置界面代码3. 前台服务创建常驻通知 二、快捷方式1. 测试添加动态快捷方式代码 三、开发者图块四、桌面小部件 基于jetpack compose 框架的使用代码 一、通知 参见 官方文档 0. 配置权限 uses-permission android:nameandroid.permission.POST_NOTIFICATIONS /1. 测试发送通知代码 Button(onClick { val channelId notify1val manager getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManagerval channel NotificationChannel(channelId, 通知消息1, NotificationManager.IMPORTANCE_HIGH).apply {description this is a test channelsetShowBadge(true)enableVibration(true)setAllowBubbles(true)enableLights(true)}manager.createNotificationChannel(channel)val pendingIntent PendingIntent.getActivity(context, 1002,Intent(thisMainActivity, WakeActivity::class.java),PendingIntent.FLAG_MUTABLE)val noticeId Random.nextInt()val notification NotificationCompat.Builder(context, channelId).setSmallIcon(R.drawable.future).setContentTitle(未来).setContentText(未来已经到了).setStyle(NotificationCompat.BigPictureStyle().bigPicture(BitmapFactory.decodeResource(resources, R.drawable.future))).setBadgeIconType(NotificationCompat.BADGE_ICON_LARGE).setNumber(10).setAllowSystemGeneratedContextualActions(true).setBubbleMetadata(NotificationCompat.BubbleMetadata.fromPlatform(BubbleMetadata.Builder(a bubble 1).build())).setContentIntent(pendingIntent).build()val timer object:CountDownTimer(3000, 3000){override fun onTick(millisUntilFinished: Long) {}override fun onFinish() {manager.notify(noticeId, notification)}}timer.start() }){Text(text 测试) }2. 打开通知设置界面代码 Button(onClick { val intentSetting Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)intentSetting.putExtra(Settings.EXTRA_APP_PACKAGE, packageName)// intentSetting.putExtra(Settings.EXTRA_CHANNEL_ID, chat4)startActivity(intentSetting) }) {Text(text 测试) }3. 前台服务创建常驻通知 override fun onCreate() {super.onCreate()Log.e(TAG, onCreate: create sevice, )val channelId foregroundServiceval manager getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManagerval channel NotificationChannel(channelId, 前台服务, NotificationManager.IMPORTANCE_HIGH).apply {description this is a foregroundService notification}manager.createNotificationChannel(channel)val pendingIntent PendingIntent.getActivity(this, 1003,Intent(this, MainActivity::class.java),PendingIntent.FLAG_MUTABLE)val notification NotificationCompat.Builder(this, channelId).setSmallIcon(R.drawable.future).setContentTitle(实时服务).setContentText(未来已经到了).setContentIntent(pendingIntent).build()startForeground(Random.nextInt(), notification) }二、快捷方式 参见 官方文档 1. 测试添加动态快捷方式代码 Button(onClick { ShortcutManagerCompat.addDynamicShortcuts(context, listOf(ShortcutInfoCompat.Builder(context, id1).setShortLabel(Website 1).setLongLabel(Open the website ${Random.nextInt()}).setIcon(IconCompat.createWithResource(context, R.drawable.future)).setIntent(Intent(Intent.ACTION_VIEW,Uri.parse(https://www.mysite.example.com/))).build(),ShortcutInfoCompat.Builder(context, id2).setShortLabel(Website 7).setLongLabel(Open the website ${Random.nextInt()}).setIcon(IconCompat.createWithResource(context, R.drawable.future)).setIntent(Intent(Intent.ACTION_VIEW,Uri.parse(https://www.mysite.com/))).build(),ShortcutInfoCompat.Builder(context, id4).setShortLabel(Website 6).setLongLabel(Open the website ${Random.nextInt()}).setIcon(IconCompat.createWithResource(context, R.drawable.future)).setIntent(Intent(Intent.ACTION_VIEW,Uri.parse(https://www.mysite.com/))).build(),ShortcutInfoCompat.Builder(context, id3).setShortLabel(Website 5).setLongLabel(Open the website ${Random.nextInt()}).setIcon(IconCompat.createWithResource(context, R.drawable.future)).setIntent(Intent(Intent.ACTION_VIEW,Uri.parse(https://www.mysite.com/))).build(),ShortcutInfoCompat.Builder(context, id5).setShortLabel(Website 4).setLongLabel(Open the website ${Random.nextInt()}).setIcon(IconCompat.createWithResource(context, R.drawable.future)).setIntent(Intent(Intent.ACTION_VIEW,Uri.parse(https://www.mysite.com/))).build(),ShortcutInfoCompat.Builder(context, id6).setShortLabel(Website 3).setLongLabel(Open the website ${Random.nextInt()}).setIcon(IconCompat.createWithResource(context, R.drawable.future)).setIntent(Intent(Intent.ACTION_VIEW,Uri.parse(https://www.mysite.com/))).build())) }) {Text(text 测试) }三、开发者图块 参见 官方文档 四、桌面小部件 参见 官方文档
http://www.zqtcl.cn/news/923677/

相关文章:

  • 网站页面设计规范大连装修公司哪家好
  • 祁东网站建设微信公众号做的网站
  • 火山开发软件可以开发网站吗盐城代运营
  • 网页制作与网站建设从入门到精通民宿客栈网站制作
  • 如何写手机适配网站自己做的网站能上传到凡科吗
  • 建设公司网站开发方案seo优化工具的种类
  • 没备案的网站怎么做淘客企业做网站服务费
  • 网址站点异常怎么解决机关单位建设网站 说明
  • 阿虎手机站青岛关键词排名系统
  • 西安网站建设聚星互联网站成功案例
  • 山东鲁为建设集团网站百度的合作网站有哪些
  • 电子商务网站建设与管理程序设计题6哪家微网站做的好
  • 网站建设图文片平面网页设计是什么
  • 域外网站宁波建设监理协会
  • 胶州网站建设公司哪家好wordpress怎么改标题
  • php网站开发综合案例免费注册推广网站
  • 邯郸做网站的地方广州网站制作
  • 企业网站制作公司24小时接单郑州手机网站推广外包
  • 接做施工图的网站手机移动网站模板
  • 做网站月薪资多少钱如何打开微信小程序
  • 免费建站网站一级大录像不卡在线看网页无锡网站排名提升
  • 无锡门户网站制作服务郑州艾特网站建设
  • 建设网站 万网网页设计表单代码模板
  • 网站速度查询app开发模板网站
  • 国外案例网站做电商网站有什么用
  • 自己做的网站点击赚钱免费制作二级网站
  • 产品包装设计网站网站开发所需费用
  • 新手学做百度联盟网站html水平导航栏怎么做
  • 单页网站排名seo营销软件
  • 网站建设项目报告书广州品牌网站设计价格