Try below code:
@Override
protected void onDestroy() {
if(mplayer!=null && mplayer.isPlaying())
{
mplayer.stop();
mplayer.release();
mplayer = null;
}
super.onDestroy();
}
More Related Contents:
- Android – How to create clickable listview?
- Been staring at my code for an hour and still can't see the issue. Android – Java development [closed]
- Android: Why doesn’t my Service start?
- How to set margin for ImageView in pixels in android java?
- Update Eclipse with Android development tools v. 23
- custom listview adapter getView method being called multiple times, and in no coherent order
- Populating a ListView using an ArrayList?
- Android Eclipse – Could not find *.apk
- How can I get Android Wifi Scan Results into a list?
- Android Studio 3.1.3 Gradle Sync Error. Could Not Download Gradle-Core.jar
- NoClassDefFoundError in Eclipse
- What is difference between @+id/android:list and @+id/list
- Error launching Android Studio: Failed to create JVM: error code-6
- Issue when using a custom font – “native typeface cannot be made”
- Android Layout with ListView and Buttons
- Fatal Error: Invalid Layout of java.lang.String at value
- Android Studio: failed to complete gradle execution, cause is empty
- Error inflating class com.google.ads.AdView
- Android Geocoder getFromLocationName always returns null
- SRC folder in Eclipse is empty (MainActivity class not created) after creating a new android project using Eclipse
- No resource identifier found for attribute ‘layout_behavior’ in package
- eclipse with Android sdk, ERROR: Java heap space
- How to exit an Android app programmatically?
- Android app in Eclipse: Edit text not showing on Graphical layout
- Error:Timeout waiting to lock buildscript class cache for build file when change minSdkVersion
- Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio
- How to enable ProGuard obfuscation in Android Studio?
- How can i replace type_orientation (is deprecated) for android 4.0.3?
- Can’t run JUnit 4 test case in Eclipse Android project
- Error:Could not initialize class com.android.sdklib.repositoryv2.AndroidSdkHandler