android 广播,manifest.xml注册,代码编写
来源:互联网 发布:瓜子二手车 知乎 编辑:程序博客网 时间:2024/04/30 09:26
1.种
private void downloadBr(File file) {
// 广播出去,由广播接收器来处理下载完成的文件
Intent sendIntent = new Intent("com.test.downloadComplete");
// 把下载好的文件的保存地址加进Intent
sendIntent.putExtra("downloadFile", file.getPath());
sendBroadcast(sendIntent);
}
<receiver android:name="com.yuxin.mhealth.ui.dbmanager.DownLoadBR" >
<intent-filter>
<action android:name="com.test.downloadComplete" >
</action>
</intent-filter>
</receiver>
2种
public static void start(Context context,String fileUrl,String name){
Intent downloadIntent = new Intent(context, DownloadFileService.class);
Bundle bundle = new Bundle();
bundle.putString("url", fileUrl);
bundle.putString("fileName", name);
downloadIntent.putExtras(bundle);
context.startService(downloadIntent);
}
<service android:name="com.yuxin.mhealth.ui.dbmanager.DownloadFileService" >
</service>
- android 广播,manifest.xml注册,代码编写
- android的广播介绍,在manifest .xml中注册广播
- android 代码方式注册广播接收着
- 5.Android-Manifest.xml文件注册活动、声明主活动
- 在Android Manifest中注册DownloadManager下载完成发送的广播
- 代码注册广播接收器
- mars android开发之一:在AndroidMainfest.xml中注册广播
- Android中关闭XML注册的广播receiver方法
- android Manifest.xml选项
- Android Manifest.xml解析
- android Manifest.xml选项
- android Manifest.xml选项
- android Manifest.xml选项
- android Manifest.xml选项
- android 学习manifest.xml
- Android Manifest.xml详解
- android Manifest.xml选项
- android Manifest.xml选项
- linux 新建tomcat服务
- sql语句正确,但是报错java.sql.SQLSyntaxErrorException ORA-00907: 缺失右括号
- IP定位,手机号码及身份证号码查询接口
- ormlite更改数据库默认位置
- 什么样的项目一定可以拿到投资
- android 广播,manifest.xml注册,代码编写
- Ubuntu配置vim增加Ctag+Tlist+Nerdtree方便使用
- 使用DatagramSocket发送、接收数据(Socket之UDP套接字)
- jQuery插件实现select下拉框左右选择_交换内容
- LIBSVM的使用方法
- 《算法竞赛入门经典》习题2-5 统计(stat)
- Python处理海量数据的实战研究
- 注册机源码
- Android的Theme的设置和Style的使用