title: java.lang.NullPointerException: println needs a message android database error
body: <p>I have made a database and it gives me this error. </p>
  
  <p>This is the logcat.</p>
  
  <pre><code>02-19 15:33:38.057    1273-1273/tubapps.dbtutorial E/AndroidRuntime﹕ FATAL EXCEPTION: main
      java.lang.RuntimeException: Unable to start activity ComponentInfo{tubapps.dbtutorial/tubapps.dbtutorial.EditIncome}: java.lang.NullPointerException: println needs a message
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
              at android.app.ActivityThread.access$600(ActivityThread.java:130)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
              at android.os.Handler.dispatchMessage(Handler.java:99)
              at android.os.Looper.loop(Looper.java:137)
              at android.app.ActivityThread.main(ActivityThread.java:4745)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:511)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
              at dalvik.system.NativeStart.main(Native Method)
       Caused by: java.lang.NullPointerException: println needs a message
              at android.util.Log.println_native(Native Method)
              at android.util.Log.d(Log.java:138)
              at tubapps.dbtutorial.EditIncome.onCreate(EditIncome.java:66)
              at android.app.Activity.performCreate(Activity.java:5008)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
              at android.app.ActivityThread.access$600(ActivityThread.java:130)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
              at android.os.Handler.dispatchMessage(Handler.java:99)
              at android.os.Looper.loop(Looper.java:137)
              at android.app.ActivityThread.main(ActivityThread.java:4745)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:511)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>And this is my activity.</p>
  
  <pre><code>public class EditIncome extends ActionBarActivity {
  
      DBHelper helper = new DBHelper(this);
      private Calendar calendar;
      private TextView dateView;
      private int year, month, day;
  
      TextView payer;
      TextView amount;
      Spinner payments;
      Spinner category;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_edit_income);
  
          dateView = (TextView) findViewById(R.id.input_date);
          calendar = Calendar.getInstance();
          year = calendar.get(Calendar.YEAR);
          month = calendar.get(Calendar.MONTH);
          day = calendar.get(Calendar.DAY_OF_MONTH);
          showDate(year, month + 1, day);
  
          payer = (TextView) findViewById(R.id.input_payer);
          amount = (TextView) findViewById(R.id.input_amount);
          dateView = (TextView) findViewById(R.id.input_date);
  
          payments = (Spinner) findViewById(R.id.incomeNumber);
          ArrayAdapter&lt;CharSequence&gt; payments_adapter = ArrayAdapter.createFromResource(this,
                  R.array.recurring_income, android.R.layout.simple_spinner_item);
          payments_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          payments.setAdapter(payments_adapter);
  
          category = (Spinner) findViewById(R.id.categoryIncome);
          ArrayAdapter&lt;CharSequence&gt; income_adapter = ArrayAdapter.createFromResource(this,
                  R.array.category_income, android.R.layout.simple_spinner_item);
          income_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          category.setAdapter(income_adapter);
  
          Intent objIntent = getIntent();
          String incomeId = objIntent.getStringExtra("incomeId");
          Log.d("Reading: ", "Reading all incomes..");
          HashMap&lt;String, String&gt; incomeList = helper.getIncomeInfo(incomeId);
          Log.d("incomeAmount",incomeList.get("incomeAmount"));
          Log.d("incomePayer",incomeList.get("incomePayer"));
          Log.d("incomeDate",incomeList.get("incomeDate"));
          Log.d("incomeCategory",incomeList.get("incomeCategory"));
          Log.d("incomePayments",incomeList.get("incomePayments"));
          if(incomeList.size()!=0) {
              amount.setText(incomeList.get("incomeAmount"));
              payer.setText(incomeList.get("incomePayer"));
              dateView.setText(incomeList.get("incomeDate"));
              payments.setSelection(getIndex(payments, "incomePayments"));
              category.setSelection(getIndex(category, "incomeCategory"));
          }
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_edit_income, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  
      public void setDate(View view) {
          showDialog(999);
      }
  
      @Override
      protected Dialog onCreateDialog(int id) {
          // TODO Auto-generated method stub
          if (id == 999) {
              return new DatePickerDialog(this, myDateListener, year, month, day);
          }
          return null;
      }
  
      private DatePickerDialog.OnDateSetListener myDateListener
              = new DatePickerDialog.OnDateSetListener() {
  
          @Override
          public void onDateSet(DatePicker arg0, int arg1, int arg2, int arg3) {
              // TODO Auto-generated method stub
              // arg1 = year
              // arg2 = month
              // arg3 = day
              showDate(arg1, arg2 + 1, arg3);
          }
      };
  
      private void showDate(int year, int month, int day) {
          dateView.setText(new StringBuilder().append(day).append("/")
                  .append(month).append("/").append(year));
      }
  
      public void editIncome(View view) {
          HashMap&lt;String, String&gt; queryValues = new HashMap&lt;String, String&gt;();
          payer = (TextView) findViewById(R.id.input_payer);
          amount = (TextView) findViewById(R.id.input_amount);
          dateView = (TextView) findViewById(R.id.input_date);
  
          payments = (Spinner) findViewById(R.id.incomeNumber);
          ArrayAdapter&lt;CharSequence&gt; payments_adapter = ArrayAdapter.createFromResource(this,
                  R.array.recurring_income, android.R.layout.simple_spinner_item);
          payments_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          payments.setAdapter(payments_adapter);
  
          category = (Spinner) findViewById(R.id.categoryIncome);
          ArrayAdapter&lt;CharSequence&gt; income_adapter = ArrayAdapter.createFromResource(this,
                  R.array.category_income, android.R.layout.simple_spinner_item);
          income_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          category.setAdapter(income_adapter);
          Intent objIntent = getIntent();
          String incomeId = objIntent.getStringExtra("incomeId");
          queryValues.put("incomeId", incomeId);
          queryValues.put("incomeAmount", amount.getText().toString());
          queryValues.put("incomePayer", payer.getText().toString());
          queryValues.put("incomeDate", dateView.getText().toString());
          queryValues.put("incomeCategory", category.getSelectedItem().toString());
          queryValues.put("incomePayments", payments.getSelectedItem().toString());
  
          helper.updateIncome(queryValues);
          this.callHomeActivity(view);
      }
  
      public void removeIncome(View view) {
          Intent objIntent = getIntent();
          String incomeId = objIntent.getStringExtra("incomeId");
          helper.deleteIncome(incomeId);
          this.callHomeActivity(view);
  
      }
      public void callHomeActivity(View view) {
          Intent objIntent = new Intent(getApplicationContext(), MainActivity.class);
          startActivity(objIntent);
      }
  
      private int getIndex(Spinner spinner, String myString) {
  
          int index = 0;
  
          for (int i = 0; i &lt; spinner.getCount(); i++) {
              if (spinner.getItemAtPosition(i).equals(myString)) {
                  index = i;
              }
          }
          return index;
      }
  }
  </code></pre>
  
  <p>P.S. The 66 line is   <code>Log.d("incomeAmount",incomeList.get("incomeAmount"));</code></p>
  
  <p>I have found something on the internet but it doesn't solve my problem. Also I'm a beginner so please don't over react.</p>