注册接收器,在App启动服务安装不工作 [英] Register receivers, start services on App install doesn't work

查看:186
本文介绍了注册接收器,在App启动服务安装不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个开始,只要它安装在运行的应用程序,即BroadcastReceivers和服务是一旦应用程序被安装在手机上注册。我已经删除从主Activity类的动作MAIN和LAUNCHER类别。这适用于之前4.0的Andr​​oid OS系统的工作。
但在操作系统4.0及以上,我有至少一次的应用程序安装在手机上后,打开主界面/活动画面。是不是有什么改变谷歌与问候他们的政策?

I have an Application that starts running as soon as it is installed, i.e. the BroadcastReceivers and Services are register as soon as the Application is installed on the handset. I've removed the action MAIN and category LAUNCHER from the main Activity class. This used to work in the Android OS systems prior to 4.0. But on the Operating Systems 4.0 and above, I'm having to open the main UI/Activity screen at least once after the Application is installed on the handset. Is there something Google changed with regards to their policies?

推荐答案

由于Android 3.1的你需要的是推出了BOOT_COMPLETED意图之前至少一次启动该应用程序(我假设是你在做什么)。看看这个链接

As of android 3.1 you need to start the application at least once before the BOOT_COMPLETED intent is launched (I am assuming that is what you are doing). Look at this link

这篇关于注册接收器,在App启动服务安装不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆