My application needs the user to choose at startup whether they want to hear the sounds of the app or not, as it is an application to also be used in the classroom and in that environment the volume of the app must be zeroed. >
So I created a AlertDialog
so once the app is run the user decides whether or not to lower the volume, like this:
AlertDialog.Builder dlg = new AlertDialog.Builder(ActDinamica.this);
dlg.setTitle("Bem Vindo!");
dlg.setMessage("Você está em aula?");
dlg.setPositiveButton("Sim", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Mute();
}
});
dlg.setNegativeButton("Não", null);
dlg.show();
So I need to set this Mute();
method so that the volume of the cell phone's media audio goes to zero.
Method:
private void Mute() {
// codigo para o volume zerar?
}
Note: I found only methods to stop specific audios that were being executed ...