1

Hi i have a problem like, I have a chronometer its shows recording time if i press a record button of a live video streaming, both are dynamic. Once i clicked the record the recording will takes place in server side, so no problem about that but the problem is after clicking the record button when the recording timer starts, if i changed my mobile orientation it automatically starts again from onCreate and the chronometer and the button is not visible, video is continuing. i should continue both the button and timer along with the video even after the orientation done. I have already tried like adding android:configChanges="orientation" and in class file onConfigurationchanged() but its not working.... can u anyone please help me

Droidand
  • 176
  • 1
  • 4
  • 10

3 Answers3

0

Into AndroidManifest.xml add this:

android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"

This lines c&p at header of document into <manifest...

And this other into <activity...:

android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"

Other option is change "portrait" with "landscape" for panoramic view.

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
Skurdo
  • 79
  • 1
  • 8
0

You can disable the rotaion by adding android:screenOrientation="portrait" (or landscape) to the element in the manifest.

Arun
  • 3,036
  • 3
  • 35
  • 57
0

use this attribute in manifest file android:configChanges="orientation|keyboardHidden" and also u should override the onConfigurationChanged() in your activity file..

fargath
  • 7,844
  • 6
  • 24
  • 36