update mediaplayer song
<p>I've a preferences with a boolean (sound yes/no) and listpreferences with 3 sounds. Boolean starts/stops a service. When I change sound from listpreferences I can't update (stop service, update song list, start service), my code:</p>

<pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
na = prefs.getBoolean("na2", false);
if (na){
    startService(new Intent(this, UnUsedService.class));
}
else {
    stopService(new Intent(this, UnUsedService.class));
}
</code></pre>

<p>service:</p>

<pre><code>public void onCreate() {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
    sna = prefs.getString("sna2", "");

    if (sna.equals("1")){
        player = MediaPlayer.create(this, R.raw.1);
        player.setLooping(true); // Set looping
    }
    if (sna.equals("2")){
        player = MediaPlayer.create(this, R.raw.2);
        player.setLooping(true); // Set looping
    }
    if (sna.equals("3")){
        player = MediaPlayer.create(this, R.raw.3);
        player.setLooping(true); // Set looping
    }
</code></pre>
