1

//here is my code

  if (mPreviewRunning) {
                mCamera.stopPreview();
            }
        Camera.Parameters p = mCamera.getParameters();
        p.setPreviewSize(w, h);
        //mCamera.setDisplayOrientation(270);
        mCamera.setParameters(p);
        try {
            mCamera.setPreviewDisplay(holder);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        mCamera.startPreview();
        mPreviewRunning = true;`

when i was open my camera its only show in landscape mode. how to change in portrait mode...

Padma Kumar
  • 20,710
  • 17
  • 71
  • 129
Androider
  • 17
  • 1
  • 7
  • possible duplicate of [How to set Android camera orientation properly?](http://stackoverflow.com/questions/4645960/how-to-set-android-camera-orientation-properly) – mac Dec 30 '11 at 10:14

1 Answers1

0

Try this

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRIAT); 
BoltClock
  • 665,005
  • 155
  • 1,345
  • 1,328
Vassan
  • 56
  • 1
  • 4