You have re-declared the variables in onCreate
making it local to onCreate
where as the instance variables are not initialized.
Hence NPE @ CreateAppointment.java
line 51 which is probably String getTitle = nameTextBox.toString();
Change to
EditText nameTextBox;
EditText timeTextBox;
EditText detailsTextBox;
Button createButton ;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.create);
createButton = (Button)findViewById(R.id.apptSave);
nameTextBox = (EditText)findViewById(R.id.apptName);
timeTextBox = (EditText)findViewById(R.id.apptTime);
detailsTextBox = (EditText)findViewById(R.id.apptDetails);
calendar= (CalendarView)findViewById(R.id.calendar);
And change this
String getTitle = nameTextBox.toString();
String getTime = timeTextBox.toString();
String getDetails = detailsTextBox.toString();
to
String getTitle = nameTextBox.getText().toString();
String getTime = timeTextBox.getText().toString();
String getDetails = detailsTextBox.getText().toString();
Edit:
See this
private AppointmentsData appointments;
String string;
Only declared not initialized.
You have not initialized
string
.You have not initialized
appointments
.appointments = new AppointmentsData(this); // after activity is created // can be initialized in onCreate
hence you get NPE