Skip to content Skip to sidebar Skip to footer

Ondestroy Crash After Closing App

I'm having some problems after making an override of the method onDestroy. My app is a music player, using the instance of mediaplayer I need at some point to force the release of

Solution 1:

super.onDestroy() must be the first call of the onDestroy method if you override it.

Solution 2:

Try the below code it works for me

@Override

public void onDestroy() {

    mediaPlayer.stop();

    super.onDestroy();

        }

}

Post a Comment for "Ondestroy Crash After Closing App"