开发者

Handling Device Rotation

I want to disable the view change on device rotation for the time being. Its giving foreclose error when i rotate the device and starts all over again.

I have used tab activity everywhere.

Ho开发者_如何学Pythonw should i proceed ?


In your manifest, you can define which activities you don't want to rotate automatically by setting i.e.

android:screenOrientation="portrait"


You can add this on your manifest:

<activity android:name=".YourActivity"
              android:screenOrientation="portrait"
              android:label="@string/activity_label"/>

Ger


What you need to set is set the configChanges attribute of the activity in your manifest. This will still allow the user to rotate the 'phone, but tells Android not to restart your activity when it does so.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜