I need two dates, the onDateSet method executes and puts the dateout in the two Textview

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");
}
    
asked by anonymous 06.10.2017 / 18:08

0 answers