Answer the question
In order to leave comments, you need to log in
How to pass multiple parameters to a service?
There is a main activity from which the service is launched via onBindService (). I found lessons in which they pass one parameter at a time. And how to make it possible to pass several variables to the service at once?
The first thing I tried was calling the procedure inside the service from the activity with passing parameters:
kvService.changeservice(KVStartTime_btn.getText().toString(), KVNorma_btn.getText().toString());
public void changeservice(String kvStartTime, String kvNorma){
...
}
Answer the question
In order to leave comments, you need to log in
Read the article about Bound Services , you can organize a messenger and send messages to the service through its binder, you can communicate with broadcasts, then the binder is not needed. You can make your own binder, you can do it in different ways.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question