I have a service with an following constructor:
public ShimmerService(Context context, Handler handler) {
mHandler = handler;
}
I want
intent service = new Intent(current context, your service name.class);
`service.putExtra(key,value);`// put your sightly variable type
`service.setAction("StartDownload");`// action that will detect in onStartCommand
current context.startService(service);
in service, in onStartCommand:
if (intent.getAction().equals("StartDownload")) {
`intent.getExtras().getString(key)`;// string in this sample should be your variable type as you used in your code
//do what you want
}`