title: How to let Activity control service?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4300291/example-communication-between-activity-and-service-using-messaging">Example: Communication between Activity and Service using Messaging</a>  </p>
  </blockquote>
  
  
  
  <p>I'm having a trouble with my service, I googled from yesterday to now and got nothing decent result.</p>
  
  <p>Now I have a activity with some buttons ( Play/Pause, Next, Previous) and a service (contains a MediaPlayer  and others). I want to control my service to do somethings when I press a button on Activity.</p>
  
  <p>I got how to send data from activity to service but that causes my problem.</p>
  
  <p>To connect to service, I used startService(intent) with intent included some data, and in service class, I overrode onStartCommand(...) and now my service received that data.</p>
  
  <p>That's great, but now I can not control my service.</p>
  
  <p>And then, I approached to another way - Bound Service.</p>
  
  <p>I also got how to create a bound service class and connect to it to interact with. But now, because onstartCommand is only called by startService() so I don't know how to get data from activity without override this method.</p>
  
  <p>My question is: How to let activity control and send data to a service?
  Thank you.</p>