in my application I got the date and time via DatePicker and TimePicker and set reminder on Perticular user selected Date and Time, But I already done Date and Time Picker but don't know how to set reminder on that, Kindly help me.Thanks
Set an Alarm using AlarmManager, or create a Calendar event using the Calendar Provider API.
Related
I want to disable the specific dates which user selected in another date picker
I mean user selects date in first date in date picker and another date picker sets minimum date?
That functionality does not available in Android DatePicker. You need to use a custom date picker.
You can use MaterialDateTimePicker library, here you can set an option to disable specific dates by using setDisabledDays() API.
For Example:
datePicker.setDisabledDays(Calendar[] days)
You need to pass array of Calendar days as an parameter which should contains all the disable dates.
you can use setMinDate() function to set the minimum date in date picker.
I have implemented DatePicker and TimePicker in android.
Now, As we know that DatePicker prompts user to give input only for specific date, same as TimePicker prompts user to give input only for specific time. But, I require to make a single CustomView that handle to take date and time both as input from user.
How can I do this ?
Thanks in Advance.
DateTime Picker
Hope this helps...
There is a Project Sample Which has both Date And Time Picker Together.
You can find a DateTimePicker implementation here
I have a two dates for example 17/3/2012 and 18/3/2012 and I want to set these dates in alarm manager . how to use calendar instance to add them?
You can use the Calendar class and its set() method. It takes two parameters: a Calendar field, such as YEAR, MONTH, HOUR_OF_DAY, and the value of the field. You must initialize the Calendar object, setting all the fields as you need, and then call getTimeInMillis() to get the time in milliseconds. Here's a link to the Calendar reference: Calendar. Hope this helps.
By Stack Overflow question How to add a calendar event on an Android device with a given date? I set the calendar event, but how do I know that the user has set the calendar event or not set it?
Do you mean you want the user to pick a date? You can use the date picker dialog and a listener. Here is a tutorial which explains you how to do it:
http://developer.android.com/resources/tutorials/views/hello-datepicker.html
I am basically using a datetime control in my application.
Wherein on a click event i am initiating datetime dialog.
In another scenario, i want to move current date, to next day, or previous day.
I don't want the dialogbox of date time control to be displayed.
Is it possible??
The DatePicker and TimePicker controls are available as widgets for you to use in your layouts or code.
You can then build the next day / previous day functionality yourself by setting the date / time of those controls.