I have made a method that allows me to choose the date of a calendar that is shown and paste the selection in an EditText, but what I want is that by default the date of the current day appears in the EditText, without having to be selecting the year, month and day of the calendar. thanks.
Here I leave the code that implemente selecting year, month and day.
public void metodo_fecha(View v){
final Calendar c =Calendar.getInstance();
dia=c.get(Calendar.DAY_OF_MONTH);
mes=c.get(Calendar.MONTH);
ano=c.get(Calendar.YEAR);
DatePickerDialog datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
etfecha.setText(dayOfMonth+"/"+(month+1)+"/"+year);
}
},dia,mes,ano);
datePickerDialog.show();
}