After selecting date, its showing wrong month
In this case, the month count is started at 0. So you have to add 1 for display.
editStartDate.setText(selectedday + "/" + (selectedmonth + 1) + "/" + selectedyear);
See also this question for reference: Why is January month 0 in Java Calendar?
DatePicker showing month value starting from 0
According to developer.android.com month ranges from 0-11.
So you need to increment it by 1.
public void onDateSet(DatePicker view, int year, int month, int day) {
int selectedMonth = month+1;
cval_to.setText(day + "/" + selectedMonth + "/" + year);
}
Related Topics
Android: Overlay on Android Camera Preview
Which Android Ide Is Better - Android Studio or Eclipse
Does Android Support Jdk 6 or 7
Run Code Only Once After an Application Is Installed on Android Device
Activity Not Started, Its Current Task Has Been Brought to the Front
Implementing Text Watcher for Edittext
Android Listview with Checkbox and All Clickable
Android Studio 3.0 Execution Failed for Task: Unable to Merge Dex
Custom Dialog on Android: How to Center Its Title
How to Disable/Enable Dialog Negative Positive Buttons
Hiding Title in a Fullscreen Mode
Adding Local .Aar Files to My Gradle Build
Android: Webview Inside Dialog or Popup
Popupwindow $Badtokenexception: Unable to Add Window -- Token Null Is Not Valid
Configuration with Name 'Default' Not Found. Android Studio
How to Programmatically Clear Application Data
How to Generate Buildconfigfield with String Type
How to Use a Tablayout with Toolbar Inside Collapsingtoolbarlayout