2

Possible Duplicate:
android setting activity orientation by code

I got a problem need for your help. I got a chart need to view in LANDSCAPE to let the screen can view full of chart. And i'd like to set the device to view in LANDSCAPE mode, and when user rotate the device to PORTRAIT, the chart will stay in LANDSCAPE mode. I'm just a newbie, could anyone tell me how to achieve that.

Thanks for any comments

Clark

Community
  • 1
  • 1
user1597721
  • 313
  • 1
  • 6
  • 14

1 Answers1

2

refer to this activity-doc. open your AndroidManifest.xml, add this code:

<activity android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:name="myActivity">

or add this line in your activity class

myActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
HelmiB
  • 12,303
  • 5
  • 41
  • 68