android - ServiceConnection::onServiceConnected not called even though Context::bindService returns true? -


I'm trying to force a service that was started on boot from an activity to start on boot The code was mostly taken from.

This is the Android manifest for 3 main components. The XML definition is:

  & lt ;! - Receiver - & gt; & Lt; Receiver Android: name = "Receiver. Lifestyle PPAutoStarter" android: process = "android.process.lifestylepp" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.BOOT_COMPLETED" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt ;! - service - & gt; & Lt; Service Android: name = ". Service.LifestylePPService" android: process = "android.process.lifestylepp" Android: Enabled = "True" Android: export = "true" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "edu.gatech.lifestylepp.ilifestylePPService" /> & Lt; Action Android: name = "edu.gatech.lifestylepp.SERVICE" /> & Lt; / Intent-Filter & gt; & Lt; / Services & gt; & Lt ;! - Activity - & gt; & Lt; Activity Android: name = "App.Lifestyle PPActivity" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt;  

The receiver starts the service at boot no problem. However, when I try to bind service to my activity, the reference: Bindersver gives the correct, but the service connection :: onServiceConnected is never asked. Apart from this, when I start the service with activity, it works as expected (ServiceConnection :: Onesis Connected).

In addition, when I start the service with activity, then it works as expected (Service connection: called onServiceConnected).

startService () does not include an service connection object.

Get rid of both the android: process = "android.process.lifestylepp" line from your manifest. This can be a source of your problem, and more importantly, you really need two processes and all overheads.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -