This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.android.lifecycle; | |
| import android.os.Bundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.util.Log; | |
| public class MainActivity extends AppCompatActivity { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { |