解决方案 »

  1.   

    直接用startservice吗??
    不行的吧 
      

  2.   

    类似这样?
    AndroidManifest.xml 里
    <service android:name=".xxxxxxx" android:process=":xxxxxxx" />
      

  3.   

    给你一段android官方文档的描述:
    A started service is one that another component starts by calling startService(), resulting in a call to the service's onStartCommand() method.When a service is started, it has a lifecycle that's independent of the component that started it and the service can run in the background indefinitely, even if the component that started it is destroyed. As such, the service should stop itself when its job is done by calling stopSelf(), or another component can stop it by calling stopService().

    现在应该明白了吧
      

  4.   

    你应该是想问:Android 提高Service的存活率 ?这个从Android开始就在讨论,本来就是矛与盾的关系, 应用想要常驻内存, 系统想要尽量减少后台进程。  上面的那些方式都不用试了,凡是你能想到的,系统都会想到。从Android的设计理念上来看,显示具有最高的优先级,所以forground service的优先级最高,也就是你如果能绑定到通知栏,这样国产rom不管怎么处理也不大敢随便动你。  如果你是后台的,那就不好意思了。另外一个方面就是多注册recevier,不管什么乱七八糟的消息到了,你都来检测启动下service~  做成打不死的小强。  不管怎么说,保证百分百接收消息是不可能的, 连腾讯都做不到,你一小应用就更不要想了。
      

  5.   

    这个问题看上去要从service本身入手,清理内存时系统可能会把优先级低的后台service关闭。
    你要调用的是什么service?