Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I have changed my code so that the surfaceCreated and surfaceDestroyed to look like this:
- @Override
- public void surfaceCreated(SurfaceHolder holder) {
- if(mOrientationListener==null)
- {
- mOrientationListener=new MyOrientationEventListener(CameraActivity.this);
- mOrientationListener.enable();
- }
- }
- @Override
- public void surfaceDestroyed(SurfaceHolder holder) {
- // TODO Auto-generated method stub
- stopPreview();
- mOrientationListener.disable();
- surfaceHolder=null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement