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
  • 19,893
  • 17
  • 73
  • 130
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
  • 700,868
  • 160
  • 1,392
  • 1,356
Vassan
  • 56
  • 1
  • 4