New Activity issuing nullpointerexception <p>I am trying to start a new activity to display a list of results from a search. I have been through the android dev stuff and androidhive and through similar posts here dealing with populating a listview with an arraylist in a new activity and I just cant seem to get this to work. I would really appreciate any help, been battling with this for a few days now. </p> <p>Here are the relevants parts of my main activity.</p> <pre><code>Intent intent = new Intent(this, DisplayResultsActivity.class); ArrayList&lt;String&gt; myCommonFilms = new ArrayList&lt;String&gt;(commonFilms.getCommonFilms(titleOne, titleTwo)); Log.d("myCommonFilms", myCommonFilms.toString()); intent.putStringArrayListExtra("myCommonFilmsList", myCommonFilms); startActivity(intent); </code></pre> <p>Here is the new activity:</p> <pre><code>public class DisplayResultsActivity extends Activity { private ListView listView; public void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_display_results); listView = (ListView) findViewById(android.R.id.list); Intent intent = getIntent(); ArrayList&lt;String&gt; myCommonFilms = intent.getStringArrayListExtra("myCommonFilms"); Log.d("myCommonFilms in display", myCommonFilms.toString()); Log.d("ArrayListContents", myCommonFilms.toString()); final ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.expandable_list_content, myCommonFilms); Log.d("ArrayAdapterContents", arrayAdapter.toString()); listView.setAdapter(arrayAdapter); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_display_results, menu); return true; } } </code></pre> <p>Here is my manifest in case something is up there:</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tot.tipofthetongue" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" &gt; &lt;activity android:name=".Main" android:label="@string/title_activity_main" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".DisplayResultsActivity" android:label="@string/title_activity_display_results" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>Here is my main activity layout:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/home_screen_bg" &gt; &lt;EditText android:id="@+id/searchOne" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="182dp" android:background="@drawable/home_screen_edittext" android:ems="10" android:inputType="textPersonName" /&gt; &lt;Button android:id="@+id/findMovies" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="32dp" android:text="@string/buttonText" android:onClick="displayResults" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>and lastly the layout of my new activity for displaying the results</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/results_bg" android:padding="10dip" android:textSize="16dip" android:textStyle="bold" &gt; &lt;/ListView&gt; </code></pre> <p>and here is the error log: 09-13 22:42:00.127: W/dalvikvm(1168): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 09-13 22:42:00.137: E/AndroidRuntime(1168): FATAL EXCEPTION: main 09-13 22:42:00.137: E/AndroidRuntime(1168): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tot.tipofthetongue/com.tot.tipofthetongue.DisplayResultsActivity}: java.lang.NullPointerException 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.os.Handler.dispatchMessage(Handler.java:99) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.os.Looper.loop(Looper.java:123) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.app.ActivityThread.main(ActivityThread.java:4627) 09-13 22:42:00.137: E/AndroidRuntime(1168): at java.lang.reflect.Method.invokeNative(Native Method) 09-13 22:42:00.137: E/AndroidRuntime(1168): at java.lang.reflect.Method.invoke(Method.java:521) 09-13 22:42:00.137: E/AndroidRuntime(1168): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 09-13 22:42:00.137: E/AndroidRuntime(1168): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 09-13 22:42:00.137: E/AndroidRuntime(1168): at dalvik.system.NativeStart.main(Native Method) 09-13 22:42:00.137: E/AndroidRuntime(1168): Caused by: java.lang.NullPointerException 09-13 22:42:00.137: E/AndroidRuntime(1168): at com.tot.tipofthetongue.DisplayResultsActivity.onCreate(DisplayResultsActivity.java:30) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 09-13 22:42:00.137: E/AndroidRuntime(1168): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 09-13 22:42:00.137: E/AndroidRuntime(1168): ... 11 more</p>