Merge "Release MediaPlayer before letting it go out of scope."
This commit is contained in:
committed by
Android (Google) Code Review
commit
d94a7b60cc
@@ -166,6 +166,9 @@ public class Ringtone {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void openMediaPlayer() throws IOException {
|
private void openMediaPlayer() throws IOException {
|
||||||
|
if (mAudio != null) {
|
||||||
|
mAudio.release();
|
||||||
|
}
|
||||||
mAudio = new MediaPlayer();
|
mAudio = new MediaPlayer();
|
||||||
if (mUri != null) {
|
if (mUri != null) {
|
||||||
mAudio.setDataSource(mContext, mUri);
|
mAudio.setDataSource(mContext, mUri);
|
||||||
|
|||||||
Reference in New Issue
Block a user