添加旋转框后,在我的活动中。活动不节约?

时间:2013-02-14 05:15:57

标签: java android

 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(); 
    }

  });

}

     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 > 0) {
              mRowId = id;
          }
      } else {
          mDbHelper.updateTest(mRowId, title, Desc,Body, reqname);
      }


  }
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)

0 个答案:

没有答案