Tret
Tret

Reputation: 85

Android MediaRecorder. Continue recording after screen rotation

I have simple app that records audio using MediaRecorder class. When screen orientation changes audio recording stops. How can I continue recording after screen rotation? Is android:configChanges="orientation" the only way?

Upvotes: 3

Views: 930

Answers (1)

Danail Alexiev
Danail Alexiev

Reputation: 7772

You can try and move the MediaRecorder reference and recording logic to a Fragment with no UI that will be retained across the orientation change. To achieve this, you should mark the fragment instance using setRetainInstance(true).

Upvotes: 2

Related Questions