How do I detect a cancel click of the datepicker dialog?

后端 未结 12 1819
鱼传尺愫
鱼传尺愫 2020-12-03 06:51

i am using following example of date picker

http://developer.android.com/guide/tutorials/views/hello-datepicker.html

now i want to perform some functionality

12条回答
  •  独厮守ぢ
    2020-12-03 07:47

    Since DatePickerDialog is a Dialog, it supports the following:

    setOnCancelListener(OnCancelListener listener)
    setOnDismissListener(OnDismissListener listener)
    

    Using both listeners, you can identify all dismissals of the date picker dialog. The first would answer the question, the latter is for completion.

提交回复
热议问题