This is unique question in a sense that I am passing stringExtra to start the IntentService as opposed to the question that simply starts a service from within a service(my question is labeled as possible duplicate of). I am trying to start IntentService from a GcmIntentService by passing intent as such. Is it at all possible? Or I have to send the data to a broadcast receiver in the activity and pass them to the intent service? My goal is to send the location updates to a device from a separate thread.
Intent iniupdates = new Intent(this, LocationUpdater.class);
iniupdates.putExtra(LocationUpdater.PARAM_IN_PAS, pa);
iniupdates.putExtra(LocationUpdater.PARAM_IN_DRI, tok);
startService(iniupdates);
I am trying to receive this
@Override
protected void onHandleIntent(Intent intent) {
if (intent != null) {
pa = intent.getStringExtra(PARAM_IN_PAS);
dr = intent.getStringExtra(PARAM_IN_DRI);
Log.e("onhandle", dr);
} else{
Log.e("ERROR", "YOUR INTENT IS NULL");
}
}
But I am not getting anything. I don't even see that my IntentService is started.