4

i have an activity where i am opening a camera. i am using framelayout for camera preview. but i have to open camera in portrait mode which creating lot many problem, like small screen, rotation problem, can i set my framelayout to landscape even if my activity is in portrait mode

or if any idea for opening camera effectively in portrait mode will be appreciated

Thanks in advance

Sunil Pandey
  • 7,042
  • 7
  • 35
  • 48

2 Answers2

4

In API level 8 (v2.2), Camera contains a method called setDisplayOrientation. Call this method with 90 to rotate your camera display to portrait mode.

Ryan Reeves
  • 10,209
  • 3
  • 42
  • 26
  • i tried this but i am getting very small preview on screen. can you provide me any link for setting camera full screen in portrait mode – Sunil Pandey Mar 28 '11 at 15:34
  • Set both your activity to portrait in AndroidManifest.xml and call setDisplayOrientation(90). – Ryan Reeves Mar 28 '11 at 15:37
1

Try editing your AndroidManifest.xml's activity declaration:

<Activity android:screenOrientation="landscape" ... />
Zack Marrapese
  • 12,072
  • 9
  • 51
  • 69