this is my simple code to get current date and display in a text filed.but the current date is not showing i could not find any error.Please help me out geeks
month = calendar.get(Calendar.MONTH);
day = calendar.get(Calendar.DAY_OF_MONTH);
year1 = calendar.get(Calendar.YEAR);
Log.d("8999",month+" "+day+" "+year1);
DatePickerDialog datePickerDialog = new DatePickerDialog(Reminder.this,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int
year, int monthOfYear, int dayOfMonth) {
et_cal.setText("" + dayOfMonth + " - " + monthOfYear+1 + " - " + year);
Toast.makeText(Reminder.this, "" + dayOfMonth + " - " + monthOfYear + " - " + year, Toast.LENGTH_SHORT).show();
}
},year1,month,day);
datePickerDialog.show();