摘要: public class PhoneBroadcast extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.e("onReceive", "onReceive action" + intent.getAction()); if (intent.getAction().equals("test")) { Log.e("test", "test"); Tel 阅读全文
posted @ 2013-06-20 16:30 时光独白 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 项目测试的时候发现,按home键回到桌面,再用360清理内存,软件被结束,再次进入的时候报错,看了下log,以为是有的地方没有控制好,但是又不知道360结束的是什么(这个现在还没弄明白)。使用小米系统的进程管理优化内存就不报错。后来想到用Service防止软件被kill掉,查了下资料,发现google 管方就有,ForegroundService 前台服务,让服务一直以前台任务的方式运行,可以在service 的oncreate来实现前台服务, 通过这个方法必须发送一个通知栏,让用户知道服务在运行。Notification notification = new Notification(R.d 阅读全文
posted @ 2013-06-20 15:48 时光独白 阅读(4252) 评论(1) 推荐(1) 编辑