title: Null pointer error when attempting to remove textBox and Spinner
body: <p>Hey guys im trying to make a dynamic scrollable list of selectiondata which a user can add or remove a spinner and editText when they need to. I have the Spinner and editText being added without an issue, but when i try to delete the one on the bottom of the list.. I get a null pointer error.</p>
  
  <p>At first i thought it was because i was not referencing them properly (relevant editText and spinner data is held in a hashmap) however i have printed out the key names and they appear correct.</p>
  
  <p>Here is the code..</p>
  
  <p>Variables</p>
  
  <pre><code>int count = 0;
  HashMap&lt;String,Spinner&gt; spinnerMap = new HashMap&lt;String,Spinner&gt;();
  HashMap&lt;String,EditText&gt; editTextMap = new HashMap&lt;String,EditText&gt;();
  LinearLayout horzLayout;
  LinearLayout layout;
  </code></pre>
  
  <p>addRow method</p>
  
  <pre><code> public void addRow()
      {
          Toast.makeText(getApplicationContext(), "editText"+count, Toast.LENGTH_SHORT).show();
          layout = (LinearLayout) findViewById(R.id.scrollerLayout);  
          LinearLayout horzLayout = new LinearLayout(this);
          LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(
                  LinearLayout.LayoutParams.MATCH_PARENT,
                  LinearLayout.LayoutParams.WRAP_CONTENT
          );
          editTextMap.put("editText"+count, new EditText(this));
          editTextMap.get("editText"+count).setWidth(100);
          editTextMap.get("editText"+count).setHeight(40);
          spinnerMap.put("spinner"+count, new Spinner(this));
          List&lt;String&gt; spinnerItems = new ArrayList&lt;String&gt;();
          spinnerItems.add("Super Duper Bad Evil Weed");
          spinnerItems.add("Super Duper Edible Weed");
          spinnerItems.add("Funky Looking Weed");
          spinnerItems.add("Special Weed");
  
          ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(this,
                  android.R.layout.simple_spinner_item, spinnerItems);
          dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          spinnerMap.get("spinner"+count).setAdapter(dataAdapter);
          horzLayout.setOrientation(LinearLayout.HORIZONTAL);
          layout.addView(horzLayout, p);
          horzLayout.addView(spinnerMap.get("spinner"+count));
          horzLayout.addView(editTextMap.get("editText"+count));
          count++;
  
      }
  </code></pre>
  
  <p>RemoveRow Method</p>
  
  <pre><code>    public void removeRow()
  {
      count--;
      Toast.makeText(getApplicationContext(), "editText"+count, Toast.LENGTH_SHORT).show();
      horzLayout.removeView(spinnerMap.get("spinner"+count));
      spinnerMap.remove("spinner"+count);
      horzLayout.removeView(editTextMap.get("editText"+count));
      editTextMap.remove("editText"+count);
  
  }
  </code></pre>
  
  <p>Exact Error Message..</p>
  
  <pre><code>&gt; 06-09 23:48:33.369: E/AndroidRuntime(560): FATAL EXCEPTION: main
  06-09 23:48:33.369: E/AndroidRuntime(560): java.lang.NullPointerException
  06-09 23:48:33.369: E/AndroidRuntime(560):  at org.unisa.paddockpad.ScreenTwo.removeRow(ScreenTwo.java:83)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at org.unisa.paddockpad.ScreenTwo$2.onClick(ScreenTwo.java:52)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at android.view.View.performClick(View.java:3511)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at android.view.View$PerformClick.run(View.java:14105)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at android.os.Handler.handleCallback(Handler.java:605)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at android.os.Handler.dispatchMessage(Handler.java:92)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at android.os.Looper.loop(Looper.java:137)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at android.app.ActivityThread.main(ActivityThread.java:4424)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at java.lang.reflect.Method.invokeNative(Native Method)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at java.lang.reflect.Method.invoke(Method.java:511)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  06-09 23:48:33.369: E/AndroidRuntime(560):  at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p><em>update</em></p>
  
  <p>I am able to delete the views right after they are created inside that method.</p>