Android - Get time from EditText inputType=“time”

后端 未结 3 522
广开言路
广开言路 2021-01-23 04:57

I have EditText in my XML file:

   

        
3条回答
  •  无人及你
    2021-01-23 05:35

    this below code will help you

    String string = editText.getText().toString();
    DateFormat formatter = new SimpleDateFormat("hh:mm:ss a");
    Date date = formatter.parse(string);
    

提交回复
热议问题