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

    switch (item.getItemId()) {
        // Respond to the action bar's Up/Home button
      case android.R.id.home:
        finish();
      case R.id.action_save:
        DatabaseHandler databaseHandler = new DatabaseHandler(AddClinicalNotesActivity.this);
        try {
          if (historyObj._date != null) databaseHandler.addHistory(historyObj);
          if (examObj._date != null) databaseHandler.addExam(examObj);
          if (treatmentOb._date != null) databaseHandler.addTreatment(treatmentOb);
          if (Other_Notes_Activity.otherObj != null && Other_Notes_Activity.otherObj.size() > 0) {
            for (int i = 0; i < Other_Notes_Activity.otherObj.size(); i++) {
              databaseHandler.addOther(Other_Notes_Activity.otherObj.get(i));
            }
            Other_Notes_Activity.otherObj.clear();
          }

        } catch (Exception e) {
          e.printStackTrace();
        }
        finish();
        return true;
    }
    return super.onOptionsItemSelected(item);
  }