I want to know if the values of timerMinute and timerSecond are set when I choose these values from my TimePicker.
public void onTimeSet(TimePicker view, int minute, int second) {
// Do something with the time chosen by the user
this.timerMinute = minute;
this.timerSecond = second;
Toast.makeText(getActivity(), "Minute: " + minute,
Toast.LENGTH_SHORT).show();
}
I want to show a dialog inside the method onTimeSet and show the values choosen.
I’ve used Toast to show the values.
It depends on what framework you are using, are you using Fragments? You want to call
Activity#showDialog(int)or use the FragmentManager to create a DialogFragment.But here is the most basic approach:
Notice the parameters are hours and minutes (no seconds).