0
@Override
public void onDateSet(DatePicker datePicker, int year, int month , int dayOfMonth) {
//função execultada apos a escolha da data
dataSelecionada = String.format("%02d/%02d/%d", dayOfMonth, ++month, year);
data.setText(dataSelecionada);
data2.setText(dataSelecionada);
}
public DatePickerFragment(TextView data, TextView data2){
this.data = data ;
this.data2 = data2;
}
}
public void AbrirCalendario() {
// abrir calendario
DialogFragment calendario = new DatePickerFragment(data, data2);
// suporte fragment, string de indentificação do fragment
calendario.show(getSupportFragmentManager(), "datepicker");
}
I don’t understand your doubt
– Jefferson Quesado
Be a little more specific about your doubt.
– Rafael Cunha
I need a check-in date and an check-out date for room rental, but the selected date formatting takes the same date as the Datepicker and puts it on both Textview, I don’t know how else to use it
– Elnm
The tag
android-studio
should only be used for questions related to the IDE.– ramaral
Can’t help you without knowing where they’re coming from date and date2 .
– Pablo Almeida