java - Is setting Android MediaPlayer player to null when releasing necessary? -
looking @ example on how release android mediaplayer instance on official document, says should nullify object after releasing it:
here's how should release , nullify mediaplayer:
mediaplayer.release(); mediaplayer = null; // <-- instruction asking about.
is necessary? if so, why?
source: https://developer.android.com/guide/topics/media/mediaplayer.html#releaseplayer
the null
mark gc can 'collect' object.
Comments
Post a Comment