Hello I am making boxing countdown timer and I have the ring that plays at the end and start of each round. I would like to make "end" button but when I am using Intent like bellow I go to previously activity but mp3 files still working in background. How to end all tasks and go to previously activity without any mp3 and tasks in background?
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder dialog=new AlertDialog.Builder(Main3Activity.this);
dialog.setMessage("Czy napewno chcesz wyj?? z trenignu?");
dialog.setPositiveButton("Tak", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent=new Intent(Main3Activity.this, Main5Activity.class);
startActivity(intent);
}
});
dialog.setNegativeButton("Nie", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
AlertDialog dialogg=dialog.create();
dialogg.show();
}
});`
question from:
https://stackoverflow.com/questions/65882740/how-to-end-tasks-which-works-in-background 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…