How to find a replacement for deprecated method?

Viewed 13926

I am new to Android programming.

I have been following a tutorial on creating a Music Player from this website

The tutorial calls for a setAudioStreamType method from MediaPlayer Class which is deprecated. Which method replaces this deprecated method in particular? And, is there a source where we can find all deprecated methods and its current alternative?

Here is the code I have where there is a warning about a deprecated method:

public void  initMusicPlayer(){
    //set player properties
    player.setWakeMode(getApplicationContext(),
            PowerManager.PARTIAL_WAKE_LOCK);
    player.setAudioStreamType(AudioManager.STREAM_MUSIC);
    player.setOnPreparedListener(this);
    player.setOnCompletionListener(this);
    player.setOnErrorListener(this);
}
2 Answers
Related