Log in or register to post comments

Screen orientation at runtime

May 22, 2013 - 12:30am #1



I am developing an application by reusing VideoPlayback Sample code and have integrated Cloudreco in it. On the start of the application, I have to show a splash screen followed by a screen with tap button to start scanning. These screens are always coming in landscape mode. I want it to rotate as per device orientation.

I tried everything in the code. In initApplication() function in VideoPlayback, the orientaion is always landscape. Please help me in fixing this issue.

Screen orientation at runtime

May 28, 2013 - 10:45pm #6

You're welcome,   glad to hear it is solved.

Screen orientation at runtime

May 28, 2013 - 5:55pm #5

Hi AlessandroB,

Thank you for your help and really sorry for late reply. Yes, there was some problem probably in my code only. I took a fresh code and things working fine for me now. probably I was using 2.0.6 version code which was causing problem. I picked fresh 2.0.7 version and it worked like a charm :) . Thanks again

Screen orientation at runtime

May 24, 2013 - 1:07am #4

Hi, I have just tried in the VideoPlayback sample by simply changing to SCREEN_ORIENTATION_PORTRAIT in the initApplication() method, and it shows up in portrait mode.

Can you try the same (in the original sample) ?

Then I guess you might have introduced some other code that controls the orientation during the integration of Cloud Reco code.

Screen orientation at runtime

May 22, 2013 - 9:21am #3

Hi AlessandroB

Thank you for your reply. Yes, I did try that. I tried to dynamically find screen orientation at that point but it is always coming landscape. I also tried hard coding portrait at that point. It start to behave weid after that. Screen starts to change between portrait and landscape mode.

Somehow, before coming to that point the application has been changed to landscape. i checked Manifest file as well. It is not set there or anywhere else in the code.

Screen orientation at runtime

May 22, 2013 - 9:04am #2

Hi, normally you can set the orientation of any Activity using:

setRequestedOrientation( )

For instance, in the VideoPlayback.java, you can find this code:


int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;

// Apply screen orientation:


Have you tried changing that ?
Log in or register to post comments