An audio recording will now be deleted if the user presses one of the

back buttons in the file confirmation activity.
This commit is contained in:
Lyndon
2017-11-28 15:15:17 +01:00
parent d7611ec9bb
commit c81c173eb6

View File

@@ -160,9 +160,28 @@ public class FileConfirmationActivity extends AppCompatActivity implements FileC
@OnClick(R.id.chat_toolbar_back_arrow)
void backPressed() {
deleteRecording();
onBackPressed();
}
@Override
public void onBackPressed() {
deleteRecording();
super.onBackPressed();
}
private void deleteRecording() {
if(mSelectedUri.toString().contains(Constants.AUDIO_RECORDINGS_DIR)) {
File audioFile = new File(mSelectedUri.toString());
if(audioFile.exists()) {
audioFile.delete();
}
}
}
@Override
protected void onDestroy() {
InjectionHelper.destroyLoginComponent();