Skip to content

Instantly share code, notes, and snippets.

View ninja-sam's full-sized avatar
🏠
Working from home

Sarvesh Mishra ninja-sam

🏠
Working from home
View GitHub Profile
@ninja-sam
ninja-sam / Helper Method - releaseMediaPlayer()
Created June 8, 2020 21:57 — forked from udacityandroid/Helper Method - releaseMediaPlayer()
Miwok app: Cleaning up MediaPlayer resources
/**
* 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();
@ninja-sam
ninja-sam / TextView.java
Last active May 3, 2020 19:05 — forked from udacityandroid/TextView.java
Android for Beginners : Simplified TextView class
/**
* Displays text to the user.
*/
public class TextView extends View {
// String value
private String mText;
// Text color of the text
private int mTextColor;