So I'm starting a service with a putExtra
integer value that I want to pass along:
Intent i = new Intent(context, clickService.class);
i.putExtra("numClicks", thisNumClicks);
context.startService(i);
And this starts the service. The question is how do I retrieve this value back whilst in the service? Here's what I tried that I remember using in a previous project (from an activity):
int result = getIntent().getExtras().getInt("numClicks");
However getIntent()
is not defined for services I guess? What do I use then?
Thanks.