现在的位置: 首页 > 综合 > 正文

android应用只有service或者broadcastReceiver是不能被系统运行的

2018年01月18日 ⁄ 综合 ⁄ 共 385字 ⁄ 字号 评论关闭

最进在做一个应用,应用主要功能都是在一个service中实现,用一个广播接收器来接收开机启动完成的广播,然后接到广播后去启动service。刚开始的时候加了个activity来进行测试,最后要发布了就把测试用的activity去掉,只留下service和broadcastReceiver。发现安装进去后怎么都启动不了,广播收不到。在代码中看了半天也没发现问题,后来在网上找到原因: applications
are installed they are in a “stopped” state so they will not be able to run until the user explicitly launches them.

详细介绍如下:

http://commonsware.com/blog/2011/07/13/boot-completed-regression-confirmed.html

抱歉!评论已关闭.