一个普通的android的线程,如果发送广播呢? sendBroadCast好像需要context才行啊,普通线程如何去调用这个接口呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 // send information to update view Intent intent1 = new Intent(Common.MUSIC_LIST_RECEIVER); intent1.putExtra("count", mCursor.getCount()); intent1.putExtra("artistArray", artistArray); intent1.putExtra("titleArray", titleArray); intent1.putExtra("durationArray", durationArray); sendBroadcast(intent1);参考代码,直接用一个intent做参数,执行sendBroadcast就可以了,接收方通过Common.MUSIC_LIST_RECEIVER区分是哪个广播需要在manifest中注册广播 普通的线程类没有sendBroadcast接口吧... 只要已有操作就会通知到BroadcastReceiver类的receive()方法,貌似不需要线程啊 、问题是我要这个线程里广播自定义的消息,而我想问的是如果能让普通的线程类调用到sendBroadCast方法 引用 1 楼 ameyume 的回复 sendBroadcast是系统的东西,到处都可以用 在 线程启动之前 可以先把 context作为参数传进来么 同问,我想在powerui.java中发送一个广播,却报错,找不到该方法 求教:360手机助手中force stop功能是什么原理 新手求教,关于多选dialog 多选项限定 android监听usb拔插事件 请问android如何编译汇编代码? 如何android父子程序集合开发及更新架构设计 关于notification的使用出错 bug求助,下载一次金币加一次 Android不同分辨率客户端获取不同尺寸图片 怎么获取EditText中的内容(含有图片和文字)保存到sqlite数据库中 安卓小白 哪个大神能救救我 已经弄好久了 AS创建个hello world都不行 Android初学的问题 camera照片储存路径
Intent intent1 = new Intent(Common.MUSIC_LIST_RECEIVER);
intent1.putExtra("count", mCursor.getCount());
intent1.putExtra("artistArray", artistArray);
intent1.putExtra("titleArray", titleArray);
intent1.putExtra("durationArray", durationArray);
sendBroadcast(intent1);
参考代码,直接用一个intent做参数,执行sendBroadcast就可以了,接收方通过Common.MUSIC_LIST_RECEIVER区分是哪个广播
需要在manifest中注册广播
问题是我要这个线程里广播自定义的消息,而我想问的是如果能让普通的线程类调用到sendBroadCast方法
在 线程启动之前 可以先把 context作为参数传进来么