onpause mediaplayer from activity
<p>I've an activity with preferences: enable/disable sound and enable/disable sound background. Reading sharepreferences I start a service that starts mediaplayer. I need pause mediaplayer when activity goes in <code>onPause()</code> state.</p>

<p>Activity:</p>

<pre><code>// reading sharedpreferences, if true:
    startService(new Intent(this, UnUsedService.class));
</code></pre>

<p>service:</p>

<pre><code>    private PendingIntent pendingIntent;
    public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);
    player.start();

};
</code></pre>
