title: Method called after release
body: <p>these days i was try to code a custom camera, but there's many bugs i can't figure out. the most serious error log as below.</p>
  
  <pre><code>at android.hardware.Camera.setHasPreviewCallback(Native Method) 
  at android.hardware.Camera.setPreviewCallback(Camera.java:600)  
  java.lang.RuntimeException: Method called after release()   
  at android.hardware.Camera.setHasPreviewCallback(Native Method) 
  at android.hardware.Camera.setPreviewCallback(Camera.java:600)  
  at com.baitian.wenta.customcamera.CameraActivity.cameraRelease(SourceFile:210)  
  at com.baitian.wenta.customcamera.CameraActivity.runExceptionHandle(SourceFile:526) 
  at com.baitian.wenta.customcamera.CameraActivity.updateFlashStatus(SourceFile:859)  
  at com.baitian.wenta.customcamera.CameraActivity.onResume(SourceFile:152)   
  at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)  
  at com.qihoo360.mobilesafe.loader.b.callActivityOnResume(SourceFile:123)    
  at android.app.Activity.performResume(Activity.java:5280)   
  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2629)   
  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2667)    
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2140)    
  at android.app.ActivityThread.access$700(ActivityThread.java:140)   
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237) 
  at android.os.Handler.dispatchMessage(Handler.java:99)  
  at android.os.Looper.loop(Looper.java:137)  
  at android.app.ActivityThread.main(ActivityThread.java:4921)    
  at java.lang.reflect.Method.invokeNative(Native Method) 
  at java.lang.reflect.Method.invoke(Method.java:511) 
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)   
  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>it seems the Method wouldn't called after release. i make the camera null everytime when i try to release it, and there is no multithread call.
  here is the camera release code:</p>
  
  <pre><code>private void cameraRelease() {
          try {
              if (mCamera != null) {
                  mCamera.stopPreview();
                  mCamera.release();
                  mCameraExceptionLog.addLog("Camera release() After", "");
                  mCamera = null;
              }
          } catch (Throwable e) {
  
          }
      }
  </code></pre>
  
  <p>here is the camera init code</p>
  
  <pre><code>    private void initCamera() {
          try {
              if (mCamera == null) {
                  if (Build.VERSION.SDK_INT &gt;=        Build.VERSION_CODES.GINGERBREAD) {
                      mCamera = Camera.open(0);
                  } else {
                      mCamera = Camera.open();
                  }
                  mCamera.setErrorCallback(new ErrorCallback() {
  
                      @Override
                      public void onError(int error, Camera camera) {
                          isCanAutoFouce = false;
                          CameraActivity.this.setResult(ERROR_KEY);
                          CameraActivity.this.finish();
                      }
                  });
                  setFocusAreaDefault();
              }
          } catch (Throwable e) {
              runExceptionHandle(e);
          }
      }
  </code></pre>
  
  <p>Can you help me,thank you .</p>