title: Clear spinner contents on button click
body: <p>I have a spinner that is dynamically loaded with data as following</p>
  
  <pre><code>final  String[] sku = CrownApplication.mDb.getAllSKUs(Qsearch);
                  if((sku.length&gt;=1)){ 
                  ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(CrownTakeOrder.this,android.R.layout.simple_spinner_item, sku);
                  dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                  mSpner.setAdapter(dataAdapter);
  
                  }
  </code></pre>
  
  <p>This works fine,now I have a button that on clicking gets the value and sets other fields blank e.g Edittext as below. The only problen is I am not able to clear the spinner so once everything else is cleared the spinner still remains with the old Values</p>
  
  <pre><code>if (!mError) {
                  mSKU = mSpner.getSelectedItem().toString();
                  Qsearch =mQuery.getText().toString();
                  quantity =mQuantity.getText().toString();
                  String[] parts = mSKU.split(" - ");
                  str1 = parts[0];  
                  str2 = parts[1];   
  
                  addBody(Qsearch,mSKU,quantity);
  
                  mQuery.setText("");
                  mTxtview.setText("");
                  mQuantity.setText("");
                  mSKU = "empty";
  
                 //mSpner.setAdapter(null);
  
              } 
  </code></pre>
  
  <p>I have tried to use </p>
  
  <pre><code> mSpner.setAdapter(null);
  </code></pre>
  
  <p>But my app crashes....How to empty spinner? I am coding on </p>
  
  <pre><code>android:minSdkVersion="11"
      android:targetSdkVersion="15"
  </code></pre>