-
-
Save udacityandroid/f4ec40027031ba7de9352465f143c816 to your computer and use it in GitHub Desktop.
/** | |
* Clean up the media player by releasing its resources. | |
*/ | |
private void releaseMediaPlayer() { | |
// If the media player is not null, then it may be currently playing a sound. | |
if (mMediaPlayer != null) { | |
// Regardless of the current state of the media player, release its resources | |
// because we no longer need it. | |
mMediaPlayer.release(); | |
// Set the media player back to null. For our code, we've decided that | |
// setting the media player to null is an easy way to tell that the media player | |
// is not configured to play an audio file at the moment. | |
mMediaPlayer = null; | |
} | |
} |
Using the lockdown to learn
Me too.
It looks like i am the first here.
HaHaHa
I am the last one here i think :D
I am the last one here i think :D
no you r not
Last one is me
i am last second... no "one can prove me wrong but may be two can lol
op
last one
NO ONE CAN BEAT ME ... LAST COMMENT
I am Last
Siuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
But it's me the winner 🙋🏻♂️🙋🏻♂️
@syphaxal I'm here after you So technically I'm the new winner here
@JuniiiSays Well, not anymore...... HAHAHAHA
@qureshiwaqas Me who is last everywhere - (Ah shit! here we go again) o_o
Beat Me, the new winner ✌
That didn't last long
You got me 👍
what's with this? this is a reaaaally old udacity nanodegree android app
Heh! You're too early !!
You can do that but as far as I understand, a new MediaPlayer object will be created for each list item view which won't be so memory-efficient. By declaring it in activities, you create that object just once for each activity and use the same object with different audio files for different list items.