Federico García
Federico García

Reputation: 141

setRequestedOrientation doesnt work on Android Smart Tv Player

a quick question here.

I have a simple android application with just a WebView to display a web page and a preference dialog to change the orientation. When i select the one orientation the activity with the webview inside changes its orientation (landscape or portrait). I tested this on my phone and works perfect but the app must run in this Android Tv Player:

http://global.kworld-global.com/main/prod_in.aspx?mnuid=1248&modid=6&fcid=33&pcid=290&ifid=444&prodid=1814

I tested in it but it didnt worked, also i've downladed two apps to "lock" the screen in a particular orientation but didnt worked too!

It can be something related to the sensor? Probably the Tv Player doesnt have one and :

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

just works if the devices has the orientation sensor?

Thanks in advance and sorry for my poor english!

Upvotes: 4

Views: 3072

Answers (1)

Carlos
Carlos

Reputation: 386

Try this

<activity android:name=".MyActivity" 
      android:screenOrientation="nosensor" ></activity>

Put this in your manifest.

The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display will not rotate based on how the user moves the device. Except for this distinction, the system chooses the orientation using the same policy as for the "unspecified" setting.

How to prevent change of orientation when device is tilted?

Upvotes: 2

Related Questions