I have a button that when pressed it executes this method:
private void mostrarHora(final TextView t) {
final TimePickerDialog timePickerDialog = new TimePickerDialog(this,
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay,int minute) {
int h= view.getCurrentHour();
int m = view.getCurrentMinute();
setTxHora(h,m,t);
}
}, h, m, false);
timePickerDialog.setTitle("Selecciona la hora");
timePickerDialog.show();
}
My question is simple: How can I use the values found in h
and m
in another method that is in the same class? How can I "extract" them, get them out of that method?