title: Initiating a ListAdapter Throws NullPointerException
body: <p>When I'm initiating a <code>ListAdapter&lt;String&gt;</code> like this everything goes fine:</p>
  
  <p><strong>Initializing Variables</strong></p>
  
  <pre><code>List&lt;String&gt; deviceList = new LinkedList&lt;String&gt;();
  ArrayAdapter&lt;String&gt; listAdapter = new ArrayAdapter&lt;String&gt;(this,
              R.layout.deviceconnect,
              android.R.layout.simple_list_item_1, deviceList);
  </code></pre>
  
  <p>But when I add something to the list like this:</p>
  
  <p><strong>Added an item to the list</strong></p>
  
  <pre><code>List&lt;String&gt; deviceList = new LinkedList&lt;String&gt;();
  deviceList.add("Test");
  ArrayAdapter&lt;String&gt; listAdapter = new ArrayAdapter&lt;String&gt;(this,
              R.layout.deviceconnect,
              android.R.layout.simple_list_item_1, deviceList);
  </code></pre>
  
  <p>It throws a null pointer exception like this:</p>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>09-11 22:02:40.267: E/AndroidRuntime(3052): java.lang.NullPointerException
  09-11 22:02:40.267: E/AndroidRuntime(3052):     at          android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:392)
  09-11 22:02:40.267: E/AndroidRuntime(3052):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
  09-11 22:02:40.267: E/AndroidRuntime(3052):     at android.widget.AbsListView.obtainView(AbsListView.java:2267)
  09-11 22:02:40.267: E/AndroidRuntime(3052):     at android.widget.ListView.makeAndAddView(ListView.java:1769)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.ListView.fillDown(ListView.java:672)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.ListView.fillFromTop(ListView.java:733)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.ListView.layoutChildren(ListView.java:1622)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.AbsListView.onLayout(AbsListView.java:2102)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.View.layout(View.java:13754)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:948)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.View.layout(View.java:13754)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.View.layout(View.java:13754)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.View.layout(View.java:13754)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.View.layout(View.java:13754)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1866)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1687)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.Choreographer.doCallbacks(Choreographer.java:555)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.Choreographer.doFrame(Choreographer.java:525)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.os.Handler.handleCallback(Handler.java:615)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.os.Handler.dispatchMessage(Handler.java:92)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.os.Looper.loop(Looper.java:137)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at android.app.ActivityThread.main(ActivityThread.java:4745)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at java.lang.reflect.Method.invokeNative(Native Method)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at java.lang.reflect.Method.invoke(Method.java:511)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  09-11 22:16:54.689: E/AndroidRuntime(6064):     at   dalvik.system.NativeStart.main(Native  Method)
  </code></pre>
  
  <p>Could somebody help me out on this? Thanks.</p>