Pass parameters to service

35 views
Skip to first unread message

Geovani de Souza

unread,
Mar 27, 2015, 4:21:51 PM3/27/15
to robo...@googlegroups.com
Hello guys,

There is a way to pass parameters to my SpiceService class? E.g. I need to configure the service and that depends on user interaction, so I thought that

new SpiceManager(<Service>.class);

Could be:

new SpiceManager(<Service>.class, android.os.Bundle);

And on SpiceManager.bindToService():

...
final Intent intentService = new Intent(context, spiceServiceClass);
intentService
.putExtras(android.os.Bundle);   // <<<<<
Ln.v("Binding to service.");
spiceServiceConnection
= new SpiceServiceConnection();
boolean bound = context.getApplicationContext().bindService(intentService, spiceServiceConnection, Context.BIND_AUTO_CREATE);
...

Stéphane NICOLAS

unread,
Mar 27, 2015, 5:17:58 PM3/27/15
to robo...@googlegroups.com
If you need to customize your service at startup, yes, that is the only solution I see too. 

Maybe the best is ti fork RS and submit a PR. And sorry but the current pace of development is slow, RS is super stable and all team is currently out of time to make changes in RS.

S.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "RoboSpice".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse robospice+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages