Reputation: 583
Looking at the example on how to release an Android MediaPlayer instance on the official document, it is says that we should nullify the object after releasing it:
Here's how you should release and then nullify your MediaPlayer:
mediaPlayer.release();
mediaPlayer = null; // <-- instruction I am asking about.
Is this actually necessary? If so, why?
Source: https://developer.android.com/guide/topics/media/mediaplayer.html#releaseplayer
Upvotes: 5
Views: 1172