I have developed a code where I put in an EditText the time after selecting it, with this following code the problem I have is when I select a time like 05:08 I get in the EditText 5: 8 (because it is in AM) but If I was in PM, the same time I got bounced: 17: 8. and also it fulfills everything well when the chosen time is 17:54 for example. thanks!
public void metodo_horaSalida(View v){
final Calendar c= Calendar.getInstance();
hora=c.get(Calendar.HOUR_OF_DAY);
minutos=c.get(Calendar.MINUTE);
TimePickerDialog timePickerDialog =new TimePickerDialog(this, 3,new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
ethorasalida.setText(hourOfDay+":"+minute);
}
},hora,minutos,false);
timePickerDialog.show();
}