I find I can pass some String or other primitive types by using bundle.putString("foo", "bar");
or putBoolean
etc. like below:
Intent service = new Intent(getApplicationContext(), MyTaskService.class);
Bundle bundle = new Bundle();
bundle.putString("foo", "bar");
service.putExtras(bundle);
getApplicationContext().startService(service);
But how can I pass a function call back to the headless js service?