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

韶关东莞网站建设网站开发调研问卷

韶关东莞网站建设,网站开发调研问卷,wordpress分类页面添加幻灯片,工业和信息化部发短信是什么意思一、使用本地广播发送一条广播#xff08;本例为自己发送自己接收#xff0c;本地广播也可以是其他应用接收#xff09;然后接收到广播时回调Receiver类中的回调方法onReceive#xff08;#xff09;在此方法中自定义发出通知 代码 1 package com.qf.broadcastreceiver06;…一、使用本地广播发送一条广播本例为自己发送自己接收本地广播也可以是其他应用接收然后接收到广播时回调Receiver类中的回调方法onReceive在此方法中自定义发出通知 代码 1 package com.qf.broadcastreceiver06;2 3 import android.app.Activity;4 import android.app.Notification;5 import android.app.NotificationManager;6 import android.content.BroadcastReceiver;7 import android.content.Context;8 import android.content.Intent;9 import android.content.IntentFilter; 10 import android.graphics.BitmapFactory; 11 import android.os.Bundle; 12 import android.support.v4.app.NotificationCompat; 13 import android.support.v4.content.LocalBroadcastManager; 14 import android.view.View; 15 16 public class MainActivity extends Activity { 17 18 LocalBroadcastManager localBroadcastMgr;//本地广播管理器 19 20 MyReceiver myReceiver; 21 Override 22 protected void onCreate(Bundle savedInstanceState) { 23 super.onCreate(savedInstanceState); 24 setContentView(R.layout.activity_main); 25 26 //获取本地广播管理器对象 27 localBroadcastMgrLocalBroadcastManager.getInstance(getApplicationContext()); 28 29 myReceivernew MyReceiver(); 30 //注册本地广播接收器 31 localBroadcastMgr.registerReceiver(myReceiver, new IntentFilter(com.qf.broadcast.disen)); 32 } 33 34 public void sendBroadcast(View v){//发送本地广播 35 36 Intent intentnew Intent(com.qf.broadcast.disen); 37 38 //通过本地广播管理器来发送广播 39 localBroadcastMgr.sendBroadcast(intent); 40 } 41 42 43 Override 44 protected void onDestroy() { 45 super.onDestroy(); 46 47 //取消注册本地广播接收器 48 localBroadcastMgr.unregisterReceiver(myReceiver); 49 } 50 51 //定义广播接收器 52 class MyReceiver extends BroadcastReceiver{ 53 Override 54 public void onReceive(Context context, Intent intent) { 55 // TODO Auto-generated method stub 56 //发送通知 57 58 //获取系统的通知管理器组件 59 NotificationManager notifyMgr 60 (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE); 61 62 //实例化广播构造器 63 NotificationCompat.Builder builder 64 new NotificationCompat.Builder(getApplicationContext()); 65 66 //设置通知的小图标、标题、内容、滚动内容、动作等 67 builder.setSmallIcon(android.R.drawable.ic_menu_call) 68 .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher)) 69 .setContentTitle(提示) 70 .setContentText(最新消息暂定今天下午5点开会请准时回来.....) 71 //设置通知在状态栏里滚动 72 .setTicker(最新消息暂定今天下午5点开会请准时回来.....最新消息暂定今天下午5点开会请准时回来.....最新消息暂定今天下午5点开会请准时回来.....) 73 .setPriority(NotificationCompat.PRIORITY_MAX) 74 .setDefaults(Notification.DEFAULT_SOUND); 75 76 notifyMgr.notify(1, builder.build()); 77 78 } 79 } 80 } MainActivity.java 效果如下 转载于:https://www.cnblogs.com/bimingcong/p/4820434.html
http://www.pierceye.com/news/333459/

相关文章:

  • 制作手机广告的网站吉林省建设厅网站评职称系统
  • 云南建设厅网站资质证书查询自动生成app
  • 柳州正规网站制作公司大连建设厅网站
  • 北京市保障房建设投资中心网站瘫痪广州大型网站建设公司排名
  • 做电池网站的引导页室内设计联盟效果图
  • 查询备案网站成绩查询系统网站开发
  • 网站后台编辑器上传不了图片建筑工程承包网app
  • wordpress多站点插件168工程信息网
  • 网站工信部备案号没有ftp wordpress
  • 家装公司网站建设网站建立网站有免费的吗
  • 网站后台添加投票系统wordpress mip改造
  • 提升网站建设品质信息设计软件排行
  • 温州网站建设优化公司网站营销管理培训班
  • 昆明企业网站开发深圳航空公司最新官网
  • 青浦网站开发泸州建设网站
  • 福建省建设行业企业资质查询网站企业数据查询网站
  • wordpress 英文企业站东城手机网站制作
  • 搭建企业网站需要什么微商城系统网站模板
  • 班级网站怎样做ppt模板免费素材
  • 网站建设及运营 多少钱域名抢注哪个平台好
  • 抚顺营销型网站建设吴江开发区人才网
  • 余姚建设网站wordpress百度分享插件
  • iis网站服务器 建立出现问题吉林市城市建设档案馆官方网站
  • wordpress网站图片迁移打开一个网站为繁体字是怎么做的
  • 东莞规划局官方网站做网站要学一些什么
  • 网站动效是代码做的吗网站模板侵权问题
  • 网站开发语言总结有哪些怎么样让网站宣传自己
  • 网站建设公司哪家好找建设网站公司哪家好
  • 网站建设网上学a8直播免费版
  • 网上下载的免费网站模板怎么用灯箱网站开发