1
votes

I don't know if any of you have seen this before:

I have an application which has the Portrait orientation locked for every activity. However, in the HTC Pro Touch phone (and maybe this happens on other phones with physical keyboards) the application rotates to landscape mode for a few seconds and then returns to portait mode, that happens while navigating on the app. Of course this shouldn't happen but I'm not sure why it does that.

I am locking the portrait mode by calling setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) in the create method of my super class.

While I was writting this I realized that the locking instruction is called after the super.create(..), could that make a difference? (Testing takes some time if not I would know right now). If not what else could I do to avoid this auto-rotation?

Thanks in advance, I hope someone knows.

1

1 Answers

2
votes

You should set the attribute in your manifest.

<activity android:name="bla.blah.bla" android:screenOrientation="landscape" />

Unless you want to change the orientation later. But that is probably the best way to do it.