Android application force closed while exiting the application
<p>Another problem in my android application. When i click on home button, it exits from the application but saying <code>Sorry, the application has stopped unexpectedly</code></p>

<p>The code for my home button is</p>

<pre><code>ImageView home  =   (ImageView)findViewById(R.id.home1);
    home.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            kalma1.stop();
            Intent i =new Intent(Kalma1.this, null);
            i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            finish();
        }
    });
</code></pre>

<p>and the console says the following</p>

<pre><code>GC_EXTERNAL_ALLOC freed 1110 objects / 70984 bytes in 77ms
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x4001d800)
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.content.ComponentName.&lt;init&gt;(ComponentName.java:76)
at android.content.Intent.&lt;init&gt;  (Intent.java:2678)
at com.kalmas.Kalma1$5.onClick(Kalma1.java:74)
at android.view.View.performClick(View.java:2408)
at android.view.View$PerformClick.run(View.java:8816)
at android.os.Handler.handleCallback(Handler.java:587)
at  android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at  java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Sending signal. PID: 368 SIG: 9
</code></pre>
