Hi I am passing an intent with some data to start a service but I am unable to retrieve my strings ,as my OnCreate() method of the Service is called first and I have all the work in it but I am not able to retrieve intent data in this method..
Hi I am passing an intent with some data to start a service but
Share
Intent extras are for use with commands (
onStartCommand()), or possibly with requests to bind (onBind()). There is noIntentassociated with simply creating the service.Rewrite your service to do the work that is customized by the
Intentextras inonStartCommand()oronBind(). Or, consider whetherIntentextras are the right approach to use — for example, I would expect that things aServiceneeds all of the time would be available in a database orSharedPreferences.