Commit 99581aaf authored by Rominho15's avatar Rominho15
Browse files

Version 9.5.8 : correction de bugs mineurs

parent d589134d
......@@ -4,6 +4,7 @@ import android.content.Intent;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
......@@ -31,6 +32,13 @@ public class BetweenLevelActivity extends AppCompatActivity {
mp = MediaPlayer.create(this, R.raw.betweenl);
mp.start();
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
mp = null;
};
});
// Récupération des paramètres
Bundle extras = getIntent().getExtras();
score = extras.getInt("val_score");
......@@ -63,12 +71,12 @@ public class BetweenLevelActivity extends AppCompatActivity {
*/
protected void onStop() {
super.onStop();
if (mp != null) {
if (mp.isPlaying()) {
mp.stop();
mp.release();
}
try{
mp.stop();
mp.reset();
mp.release();
}catch(Exception e){
Log.d("Error :", e.toString());
}
}
}
......@@ -7,6 +7,7 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
......@@ -50,7 +51,7 @@ public class EndActivity extends AppCompatActivity {
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
mp = null;
};
});
} else {
......@@ -59,6 +60,7 @@ public class EndActivity extends AppCompatActivity {
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
mp = null;
};
});
}
......@@ -178,13 +180,13 @@ public class EndActivity extends AppCompatActivity {
*/
protected void onStop() {
super.onStop();
if (mp != null) {
if (mp.isPlaying()) {
mp.stop();
mp.release();
}
try {
mp.stop();
mp.reset();
mp.release();
}catch(Exception e){
Log.d("Error :", e.toString());
}
}
}
......@@ -5,6 +5,7 @@ import android.content.Intent;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.RadioGroup;
......@@ -32,7 +33,8 @@ public class MainActivity extends AppCompatActivity {
mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
mp.release();
}
mp = null;
};
});
}
......@@ -134,12 +136,12 @@ public class MainActivity extends AppCompatActivity {
*/
protected void onStop() {
super.onStop();
if (mp != null) {
if (mp.isPlaying()) {
mp.stop();
mp.release();
}
try{
mp.stop();
mp.reset();
mp.release();
}catch(Exception e){
Log.d("Error :", e.toString());
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment