I am developing an app for android. I have created a timepickerdialog and a datepickerdialog, but the problem is, both of them run in different dialog boxes, which is not what the way I want my app to work :-S Is there any way to create a single dialogbox with both time and date picker dialog boxes in it together?
Thx
Android Date Picker allows you to select the date consisting of day, month and year in your custom user interface. For this functionality android provides DatePicker and DatePickerDialog components.
Android DatePicker is a widget to select date. It allows you to select date by day, month and year. Like DatePicker, android also provides TimePicker to select time. The android.
Get Google Calendar On your Android phone or tablet, visit the Google Calendar page on Google Play. Tap Install. Open the app and sign in with your Google Account.
You can find a DateTimePicker implementation here:
http://code.google.com/p/datetimepicker/
I have created a custom Alert Dialog as in the Google tutorial. I replaced the ImageView and the TextView with a DatePicker and a TimePicker. I changed the following line:
View layout = inflater.inflate(R.layout.custom_dialog,
(ViewGroup) findViewById(R.id.layout_root));
with this:
View layout = inflater.inflate(R.layout.dialog_date_time,
(ViewGroup) findViewById(R.id.datePicker));
For whatever reason the first gave an error, but the second worked. Anyway, I can use the two views in the same dialog window now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With