title: Fatal Exception: java.lang.NullPointerException
body: <p>I'm trying dictionary application but get the error below;</p>
  
  <blockquote>
    <p>01-27 06:27:57.561: E/AndroidRuntime(2439): FATAL EXCEPTION: main 
        01-27 06:27:57.561: E/AndroidRuntime(2439): Process: taejung.kim.dic, PID: 2439
            01-27 06:27:57.561: E/AndroidRuntime(2439): java.lang.RuntimeException: Unable to start activity 
            ComponentInfo{taejung.kim.dic/taejung.kim.dic.DictionaryMainActivity}: java.lang.NullPointerException
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.os.Handler.dispatchMessage(Handler.java:102)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.os.Looper.loop(Looper.java:136)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.ActivityThread.main(ActivityThread.java:5017)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at java.lang.reflect.Method.invokeNative(Native Method)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at java.lang.reflect.Method.invoke(Method.java:515)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at dalvik.system.NativeStart.main(Native Method)
        01-27 06:27:57.561: E/AndroidRuntime(2439): Caused by: java.lang.NullPointerException
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at taejung.kim.dic.DictionaryMainActivity.onCreate(DictionaryMainActivity.java:45)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.Activity.performCreate(Activity.java:5231)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
        01-27 06:27:57.561: E/AndroidRuntime(2439):     ... 11 more</p>
  </blockquote>
  
  <p>The issue may be triggered by OnCreate in main activity, but I can't understand what the problem is.</p>
  
  <p>Below, my scripts;</p>
  
  <p>DictionaryMainActivity.java</p>
  
  <pre><code>package taejung.kim.dic;
  
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import java.util.ArrayList;
  import java.util.HashMap;
  import android.app.Activity;
  import android.os.Bundle;
  import android.text.Editable;
  import android.text.TextWatcher;
  import android.widget.ArrayAdapter;
  import android.widget.EditText;
  import android.widget.ListView;
  `enter code here`
  public class DictionaryMainActivity extends ActionBarActivity {
      private ListView lv;
  
      // Listview Adapter
      ArrayAdapter&lt;String&gt; adapter;
      // Search EditText
      // ArrayList for Listview
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; productList;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_list_main);
          // Listview Data
          String products[] = {"Dell Inspiron", "HTC One X", "HTC Wildfire S", "HTC Sense", "HTC Sensation XE", "iPhone 4S", "Samsung Galaxy Note 800", "Samsung Galaxy S3", "MacBook Air", "Mac Mini", "MacBook Pro"};
          // Adding items to listview
          adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.product_name, products);
          lv.setAdapter(adapter);
      }
  }
  </code></pre>
  
  <p>activity_list_main.xml</p>
  
  <pre><code>&lt;LinearLayout 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:orientation="vertical" tools:context="taejung.kim.dic.DictionaryMainActivity"&gt;
      &lt;!--  모음리스트 --&gt;
      &lt;HorizontalScrollView android:id="@+id/MoumScroll" android:layout_width="match_parent" android:layout_height="wrap_content" android:fillViewport="true"&gt;
          &lt;LinearLayout android:id="@+id/MoumList" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅏ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅑ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅓ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅕ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅗ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅛ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅜ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅠ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅡ" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="ㅣ" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/HorizontalScrollView&gt;
      &lt;!-- 자음리스트 --&gt;
      &lt;HorizontalScrollView android:id="@+id/JaumScroll" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fillViewport="true"&gt;
          &lt;LinearLayout android:id="@+id/JaumList" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ga" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/na" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/da" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ra" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ma" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ba" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/sa" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/aa" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ja" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/cha" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ka" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ta" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/pa" /&gt;
              &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/ha" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/HorizontalScrollView&gt;
      &lt;!--화면이동  --&gt;
      &lt;LinearLayout android:id="@+id/BtLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="8"&gt;
          &lt;Button android:id="@+id/BtHelp1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="도움말" android:layout_weight="1" /&gt;
          &lt;Button android:id="@+id/BtSearch1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="검색" android:layout_weight="1" /&gt;
      &lt;/LinearLayout&gt;
      &lt;ListView android:id="@+id/listview" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>list_item.xml</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"&gt;
      &lt;!-- Single ListItem --&gt;
      &lt;!-- Product Name --&gt;
      &lt;TextView android:id="@+id/product_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dip" android:textSize="16dip" android:textStyle="bold" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Manifest</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="taejung.kim.dic" android:versionCode="1" android:versionName="1.0"&gt;
      &lt;uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" /&gt;
      &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"&gt;
          &lt;activity android:name=".DictionaryMainActivity" android:label="@string/app_name" android:windowSoftInputMode="stateHidden"&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>What am I doing wrong and how can I fix it?</p>