Advertisement
vamsiampolu

Change orientation using SurfaceHolder.Callbacks...

Jan 20th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. I have changed my code so that the surfaceCreated and surfaceDestroyed to look like this:
  2.  
  3.  
  4.     @Override
  5.     public void surfaceCreated(SurfaceHolder holder) {
  6.         if(mOrientationListener==null)
  7.         {
  8.             mOrientationListener=new MyOrientationEventListener(CameraActivity.this);
  9.             mOrientationListener.enable();
  10.         }
  11.     }
  12.  
  13.     @Override
  14.     public void surfaceDestroyed(SurfaceHolder holder) {
  15.         // TODO Auto-generated method stub
  16.         stopPreview();
  17.         mOrientationListener.disable();
  18.         surfaceHolder=null;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement