So the problem is very simple:
I have integrated a DatePicker
in my application.
Not as a DialogDatePicker
but as a View component (more pr
Here is a snippet for calling device's default Date And Time Picker
date_time_layout.xml
Put this method in your class and call it using showDateAndTimePicker();
private void showDateAndTimePicker() {
final Dialog dialog = new Dialog(this,
android.R.style.Theme_DeviceDefault_Dialog);
dialog.setContentView(R.layout.date_time_layout);
dialog.setCancelable(false);
dialog.setTitle("Select Date and Time");
Button set = (Button) dialog.findViewById(R.id.dialogSet);
Button cancel = (Button) dialog.findViewById(R.id.dialogCancel);
final DatePicker dtp = (DatePicker) dialog
.findViewById(R.id.datePicker1);
final TimePicker tp = (TimePicker) dialog
.findViewById(R.id.timePicker1);
set.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Handle Set button
dialog.dismiss();
}
});
cancel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//Handle Cancel button
dialog.dismiss();
}
});
dialog.show();
}