Código:
public void sonarAlarma(){ nuclear = MediaPlayer.create(MainActivity.this, R.drawable.nuclear); nuclear.start(); } public void paraAlarma(View v){ nuclear.stop(); } flujo.setText(planta.getFlujo()); int a = Integer.parseInt(flujo.getText().toString()); if (a >4) { sonarAlarma(); } }