-4

andorid cancel DatePickerDialog when Touch Outside the code follow is not work

    datePickerDialog.setCanceledOnTouchOutside(true);
    datePickerDialog.setCancelable(true);
kimkevin
  • 2,202
  • 1
  • 26
  • 48
Alvin
  • 51
  • 9

2 Answers2

0

datePickerDialog.setCancelable(true); or use only datePickerDialog.setCancelable(true);

Zaheer
  • 19
  • 2
  • 1
    Welcome to Stack Overflow! Please feel free to take a [tour](//stackoverflow.com/tour) of the site, and if you need additional help with the site, check [this](//stackoverflow.com/help) out. Oh, and if you ever run into issues that the help page doesn't cover, feel free to ask on [meta](//meta.stackoverflow.com/). Also, please don't post answers on obviously bad questions! [See: **Should one advise on off topic questions?**](//meta.stackoverflow.com/q/276572) – Claudia Jun 20 '17 at 15:13
0

Somethinh like this,

Dialog dialog = new Dialog(context)

dialog.setCanceledOnTouchOutside(true);

Akhil0181
  • 14
  • 8