aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-09-11 21:13:56 +0200
committerChristian Schneppe <christian@pix-art.de>2018-09-11 21:13:56 +0200
commit2af9e34b6477aa34d0587d3bb1f3b7f15b117cff (patch)
tree5d20f3ba52bdfcb776908c79822d61881ffa5a7a /src/main/java/de/pixart/messenger
parent8c6030e0bf8e90a3ba67dbc6155adb2ff9000d1c (diff)
make recording activity not crash if microphone was in use
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/RecordingActivity.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/RecordingActivity.java b/src/main/java/de/pixart/messenger/ui/RecordingActivity.java
index 15d193886..455bbf3c3 100644
--- a/src/main/java/de/pixart/messenger/ui/RecordingActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/RecordingActivity.java
@@ -65,7 +65,8 @@ public class RecordingActivity extends Activity implements View.OnClickListener
super.onStart();
if (!startRecording()) {
this.binding.shareButton.setEnabled(false);
- Toast.makeText(this, R.string.unable_to_start_recording, Toast.LENGTH_SHORT).show();
+ this.binding.timer.setTextAppearance(this, R.style.TextAppearance_Conversations_Title);
+ this.binding.timer.setText(R.string.unable_to_start_recording);
}
}
@@ -108,12 +109,15 @@ public class RecordingActivity extends Activity implements View.OnClickListener
mShouldFinishAfterWrite = saveFile;
try {
mRecorder.stop();
- } catch (RuntimeException stopException) {
- //handle cleanup here
+ mRecorder.release();
+ } catch (Exception e) {
+ if (saveFile) {
+ Toast.makeText(this,R.string.unable_to_save_recording, Toast.LENGTH_SHORT).show();
+ }
+ } finally {
+ mRecorder = null;
+ mStartTime = 0;
}
- mRecorder.release();
- mRecorder = null;
- mStartTime = 0;
if (!saveFile && mOutputFile != null) {
if (mOutputFile.delete()) {
Log.d(Config.LOGTAG,"deleted canceled recording");