-1

I am implementing an app which uses an activity and a service. n my activity there is a listview which consists of a button. y activity passes two params to the service when a button of a listview item is pressed. But what if i choose multiple option i.e. items. Since the activity uses the same service is it possible to create a new instance of the same service with different params when the button is pressed.

1 Answer 1

0

You can read a lot of information about how to instantiate and how to pass parameters to a service:

http://developer.android.com/guide/components/services.html

About your question, a service is unique. If you want that this service do a different work, create a new one. But you can send as many params as you want and manage them in

protected void onHandleIntent(Intent intent)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.