In My application camera activity throws null point exception
<p>Camera activity alone creating problem in my application if I click the camera button, after taking a picture, the camera activity stops.</p>

<pre><code> imageView = (ImageView)findViewById(R.id.imageview01);
 startBtn = (Button) findViewById(R.id.startBtn);
 startBtn.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        try {
            startCamera();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
});
 public void startCamera() 
      throws IOException {
  Log.d("TDM_CAMERA", "Starting camera on the phone...");
  File photosDir = new File(Environment.getExternalStorageDirectory(), "photos");
  if (!photosDir.isDirectory()) {
      photosDir.mkdirs();
  }
  File imageFile = File.createTempFile("testphoto", ".jpg", photosDir);
  Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imageFile));
  intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
  startActivityForResult(intent, 1337);
}
</code></pre>

<p><strong>Now logcat throws Null point exception</strong> while clicking the camera button,it will takes the photo after that suddenly my application has stopped due to null point exception.</p>

<pre><code>02-21 04:13:18.672: E/AndroidRuntime(1456): FATAL EXCEPTION: main
02-21 04:13:18.672: E/AndroidRuntime(1456): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.ActivityThread.access$1300(ActivityThread.java:141)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.os.Looper.loop(Looper.java:137)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.ActivityThread.main(ActivityThread.java:5039)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at java.lang.reflect.Method.invokeNative(Native Method)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at java.lang.reflect.Method.invoke(Method.java:511)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at dalvik.system.NativeStart.main(Native Method)
02-21 04:13:18.672: E/AndroidRuntime(1456): Caused by: java.lang.NullPointerException
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:379)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
02-21 04:13:18.672: E/AndroidRuntime(1456):     at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
02-21 04:13:18.672: E/AndroidRuntime(1456):     ... 11 more
</code></pre>

<p>Now the <code>LogCat</code> shows that my activity throws null point exception, which crashes my application
 <strong>this is myactivity result</strong></p>

<pre><code>if (requestCode == IMAGE_CAPTURE) {
      if (resultCode == RESULT_OK){
          Log.d("ANDRO_CAMERA","Picture taken!!!");
          imageView.setImageURI(imageUri);
      }
  }
</code></pre>
