title: NullPointerException error for Camera Parameters
body: <p>I have the following code:</p>
  
  <pre><code>Line Code
   193 private Camera mCamera;
   &lt;!-- NO CALLS TO mCamera HERE --&gt;
   229 mCamera = Camera.open();
   230 Camera.Parameters p = mCamera.getParameters();
  </code></pre>
  
  <p>And when I run the application I get the following stacktrace:</p>
  
  <pre><code>04-08 20:56:45.330: E/AndroidRuntime(570): FATAL EXCEPTION: main
  04-08 20:56:45.330: E/AndroidRuntime(570): java.lang.NullPointerException
  04-08 20:56:45.330: E/AndroidRuntime(570):  at com.soloman.cbc.FullscreenActivity$MySurfaceView.surfaceCreated(FullscreenActivity.java:230)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.SurfaceView.updateWindow(SurfaceView.java:569)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.SurfaceView.access$000(SurfaceView.java:86)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:174)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:680)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1842)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.Choreographer.doCallbacks(Choreographer.java:562)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.Choreographer.doFrame(Choreographer.java:532)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.os.Handler.handleCallback(Handler.java:725)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.os.Handler.dispatchMessage(Handler.java:92)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.os.Looper.loop(Looper.java:137)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at android.app.ActivityThread.main(ActivityThread.java:5039)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at java.lang.reflect.Method.invokeNative(Native Method)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at java.lang.reflect.Method.invoke(Method.java:511)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
  04-08 20:56:45.330: E/AndroidRuntime(570):  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>The code I am using is from <a href="https://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview">How can I manipulate the camera preview?</a></p>
  
  <p>I have the <code>CAMERA permission</code> in the <code>AndroidManifest.xml</code>, and all <code>imports</code> are accounted for. Does anyone have any suggestions on how to fix this error?</p>
  
  <p>Thank you.</p>