Reputation: 1617
I'm trying to pop up a custom dialog when I click on a button but it won't pop up at all. my app is basically a calendar and I'm going to use sqlite to add/hold appointments and stuff to a date in the calendar using the dialog, which is where the appointment details will be specified.
The code I'm using for this is the following:
public void onClick(View v) {
// TODO Auto-generated method stub
//long a = calendar.getDate();
switch(v.getId()){
case R.id.createButton:
openCreateAppointmentDialog();
break;
}
}
private void openCreateAppointmentDialog(){
Context mContext = getApplicationContext();
Dialog createAppmntDialog = new Dialog(mContext);
createAppmntDialog.setContentView(R.layout.create);
createAppmntDialog.setTitle(R.string.createTitle);
appointmentTitle = (EditText) createAppmntDialog.findViewById(R.id.titleTextBox);
appointmentTitle.setText("hello");
appointmentTime = (EditText) createAppmntDialog.findViewById(R.id.timeTextBox);
appointmentDetails = (EditText) createAppmntDialog.findViewById(R.id.detailsTextBox);
saveAppointment = (Button) createAppmntDialog.findViewById(R.id.saveButton);
saveAppointment.setOnClickListener(this);
}
What am I doing wrong?
Upvotes: 0
Views: 760