Caused by: java.lang.NullPointerException while trying to call other Activity
<p>I am trying to call, ProductsActivity.java whenever user do click on OK in AlertDialog in ProductInformationActivity.java, but always getting an Error <strong>Caused by:java.lang.NullPointerException</strong> at line number 76th, which is </p>

<pre><code>   KEY_CATEGORY = bdl.getString("category");
</code></pre>

<p><strong>ProductInformationActivity.java:</strong></p>

<pre><code>    alertdialog.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) 
    {
      finish();
    }
});     
</code></pre>

<p><strong>ProductsActivity.java:</strong></p>

<pre><code>    list.setAdapter(adapter);

    Bundle bdl = getIntent().getExtras();
            // below is the line number 76
    KEY_CATEGORY = bdl.getString("category");
</code></pre>

<p><strong>Logcat:</strong></p>

<pre><code>05-18 16:23:25.027: E/AndroidRuntime(922): Caused by: java.lang.NullPointerException
05-18 16:23:25.027: E/AndroidRuntime(922):  at com.erachnida.restaurant.versionoct.menu.ProductsActivity.onCreate(ProductsActivity.java:76)
05-18 16:23:25.027: E/AndroidRuntime(922):  at android.app.Activity.performCreate(Activity.java:5104)
05-18 16:23:25.027: E/AndroidRuntime(922):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
05-18 16:23:25.027: E/AndroidRuntime(922):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
05-18 16:23:25.027: E/AndroidRuntime(922):  ... 11 more
</code></pre>
