How to pass data from Activity to Service without starting a new instance?
<p>I have no problem in passing data to a service using intent, extras, etc and using startService(intent)</p>

<pre><code>Intent intent = new Intent();
intent.setClass(MainActivity.this, MediaPlayerService.class);
intent.setAction(MediaPlayerService.PLAY_PAUSE);

intent.putExtra("URI", URI);
intent.putExtra("TITLE", content.toString());
//PendingIntent.getService(MainActivity.this, 0, intent, 0);
startService(intent);
</code></pre>

<p>The problem is that the service is a background service using MediaPlayer to play music. Using startService each time I'm afraid that it might be spawning multiple players, and eventually I get an ANR (even if everything is working smoothly)</p>

<p>All I need is to tell the MusicPlayerService to play a new track. Any ideas? As you can see from the code I also tried PendingIntent (suggested on the net) but it didn't seem to work</p>

<p>thanks!</p>
