Show the time picker in hh:mm format

后端 未结 4 1081
醉酒成梦
醉酒成梦 2021-01-05 07:06

I have to show the time picker in hh:mm format on Click the edit text.So that I had used the below code.

MainActivity.java:

  e6.set         


        
4条回答
  •  心在旅途
    2021-01-05 07:27

    Just now I had referred this post and change the single line:

    this line

    e6.setText(selectedHour + ":" + selectedMinute);

    to

    e6.setText(String.format("%02d:%02d", selectedHour, selectedMinute));

提交回复
热议问题