After adding the spin box,in my activity. activity is not saving?
<pre><code> private void registerButtonListenersAndSetDefaultText() {


  mConfirmButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        saveState(); 
        setResult(RESULT_OK);
        Toast.makeText(TestEditActivity.this, getString(R.string.task_saved_message), Toast.LENGTH_SHORT).show();
        finish(); 
    }

  });
</code></pre>

<p>}</p>

<pre><code>     private void saveState() {
      String title = mTitleText.getText().toString();
      String Desc = mDescText.getText().toString();
      String Body = mStepsText.getText().toString();
      String reqname= spin.getSelectedItem().toString();

      if (mRowId == null || mRowId.longValue() == 0)
      {

        long id = mDbHelper.createTest(title, Desc,Body,reqname, gprojectname,greleasename);
          if (id &gt; 0) {
              mRowId = id;
          }
      } else {
          mDbHelper.updateTest(mRowId, title, Desc,Body, reqname);
      }


  }
</code></pre>

<blockquote>
  <p>02-14 05:08:12.310: E/AndroidRuntime(834): FATAL EXCEPTION: main 02-14
  05:08:12.310: E/AndroidRuntime(834): java.lang.NullPointerException
  02-14 05:08:12.310: E/AndroidRuntime(834):    at
  com.Ibetter.tdm.TestEditActivity.saveState(TestEditActivity.java:307)
  02-14 05:08:12.310: E/AndroidRuntime(834):    at
  com.Ibetter.tdm.TestEditActivity.access$10(TestEditActivity.java:303)
  02-14 05:08:12.310: E/AndroidRuntime(834):    at
  com.Ibetter.tdm.TestEditActivity$7.onClick(TestEditActivity.java:236)
  02-14 05:08:12.310: E/AndroidRuntime(834):    at
  android.view.View.performClick(View.java:4202) 02-14 05:08:12.310:
  E/AndroidRuntime(834):    at
  android.view.View$PerformClick.run(View.java:17340) 02-14
  05:08:12.310: E/AndroidRuntime(834):  at
  android.os.Handler.handleCallback(Handler.java:725) 02-14
  05:08:12.310: E/AndroidRuntime(834):  at
  android.os.Handler.dispatchMessage(Handler.java:92) 02-14
  05:08:12.310: E/AndroidRuntime(834):  at
  android.os.Looper.loop(Looper.java:137) 02-14 05:08:12.310:
  E/AndroidRuntime(834):    at
  android.app.ActivityThread.main(ActivityThread.java:5039) 02-14
  05:08:12.310: E/AndroidRuntime(834):  at
  java.lang.reflect.Method.invokeNative(Native Method) 02-14
  05:08:12.310: E/AndroidRuntime(834):  at
  java.lang.reflect.Method.invoke(Method.java:511) 02-14 05:08:12.310:
  E/AndroidRuntime(834):    at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  02-14 05:08:12.310: E/AndroidRuntime(834):    at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 02-14
  05:08:12.310: E/AndroidRuntime(834):  at
  dalvik.system.NativeStart.main(Native Method)</p>
</blockquote>
