Skip to content

Commit 84ea5ad

Browse files
fix: sound pause at wavegenerator (#2214)
Co-authored-by: Padmal <CloudyPadmal@users.noreply.github.com>
1 parent db88ff7 commit 84ea5ad

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/src/main/java/io/pslab/activity/WaveGeneratorActivity.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,9 @@ public boolean onCreateOptionsMenu(Menu menu) {
676676
public boolean onOptionsItemSelected(MenuItem item) {
677677
switch (item.getItemId()) {
678678
case android.R.id.home:
679+
produceSoundTask.cancel(true);
680+
produceSoundTask = null;
681+
isPlayingSound = false;
679682
finish();
680683
break;
681684
case R.id.save_data:
@@ -1362,4 +1365,12 @@ protected void onCancelled() {
13621365
}
13631366
}
13641367
}
1368+
1369+
@Override
1370+
public void onBackPressed() {
1371+
super.onBackPressed();
1372+
produceSoundTask.cancel(true);
1373+
produceSoundTask = null;
1374+
isPlayingSound = false;
1375+
}
13651376
}

0 commit comments

Comments
 (0)