您好,我有一个问题,例如,我有一个天文钟,如果我按下实时视频流的录制按钮,它会显示录制时间,两者都是动态的。一旦我单击记录,记录将在服务器端进行,所以没有问题,但问题是在记录计时器启动时单击记录按钮后,如果我更改了移动方向,它会自动从 onCreate 和计时器再次启动该按钮不可见,视频正在继续。即使在定向完成后,我也应该继续按钮和计时器以及视频。我已经尝试过添加 android:configChanges="orientation" 并在类文件 onConfigurationchanged() 中添加,但它不起作用....有人可以帮助我吗
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
发布评论
评论(3)
您可以通过将 android:screenOrientation="portrait"(或横向)添加到清单中的元素来禁用旋转。
You can disable the rotaion by adding android:screenOrientation="portrait" (or landscape) to the element in the manifest.
在清单文件 android:configChanges="orientation|keyboardHidden" 中使用此属性,并且您还应该覆盖活动文件中的 onConfigurationChanged() 。
use this attribute in manifest file android:configChanges="orientation|keyboardHidden" and also u should override the onConfigurationChanged() in your activity file..
在
AndroidManifest.xml
中添加以下内容:将文档标题处的 c&p 行插入
并将其他行插入:
其他选项是将“肖像”更改为“风景”以获取全景。
Into
AndroidManifest.xml
add this:This lines c&p at header of document into
<manifest...
And this other into
<activity...
:Other option is change "portrait" with "landscape" for panoramic view.