I am trying to start one activity from another on user selection from a context menu. The code for code context menu case is:
case R.id.organize:
                   Log.d(LOGTAG, "Creating intent");
            Intent editIntent = new Intent(getApplicationContext(), AddToList.class);
            editIntent.putParcelableArrayListExtra("userPackageList", userPackages);
            Log.d(LOGTAG, "Starting activity");
            startActivity(editIntent);
            return true; 
And my AndroidManifest.xml also has entries for both the activities:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.firstapp.MyPackage"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".ActivityOne"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".ActivityTwo"
                  android:label="@string/app_name">
        </activity>
    </application>
</manifest>
The output prints both the log statements in the switch case and then crashes with the following exception:
07-18 12:32:29.516: ERROR/AndroidRuntime(601): FATAL EXCEPTION: main
07-18 12:32:29.516: ERROR/AndroidRuntime(601): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.firstapp.MyPackage/com.firstapp.MyPackage.ActivityTwo}: java.lang.NullPointerException
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.os.Looper.loop(Looper.java:123)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ActivityThread.main(ActivityThread.java:4627)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at java.lang.reflect.Method.invokeNative(Native Method)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at java.lang.reflect.Method.invoke(Method.java:521)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at dalvik.system.NativeStart.main(Native Method)
07-18 12:32:29.516: ERROR/AndroidRuntime(601): Caused by: java.lang.NullPointerException
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.Activity.setContentView(Activity.java:1647)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ListActivity.ensureList(ListActivity.java:314)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ListActivity.getListView(ListActivity.java:299)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at com.firstapp.MyPackage.ActivityTwo.<init>(ActivityTwo.java:23)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at java.lang.Class.newInstanceImpl(Native Method)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at java.lang.Class.newInstance(Class.java:1429)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-18 12:32:29.516: ERROR/AndroidRuntime(601):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
The oncreate() method for the ActivityTwo is below:
@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    ArrayList<PackageInfo> installedPkg = new ArrayList<PackageInfo>();
    installedPkg = getIntent().getParcelableArrayListExtra ("userPackageList"); 
    addItemsToList(installedPkg);
    setContentView(R.layout.main);
}
 
     
     
     
    