DatePickerDialog,TimePickerDialog在某些机型上会连续返回两次结果

前端之家收集整理的这篇文章主要介绍了DatePickerDialog,TimePickerDialog在某些机型上会连续返回两次结果前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

继承系统的dialog,重写onStop方法

class CustomTimePicker extends TimePickerDialog {
public CustomTimePicker(Context context,OnTimeSetListener callBack,int hourOfDay,int minute,boolean is24HourView) {
    super(context,callBack,hourOfDay,minute,is24HourView);
}

@Override
protected void onStop() {}

}

一样地,重写DatePickerDialog

class CustomDataPicker extends DatePickerDialog {
public CustomDataPicker(Context context,OnDateSetListener callBack,int year,int monthOfYear,int dayOfMonth) {
    super(context,year,monthOfYear,dayOfMonth);
}

@Override
protected void onStop() {}

}

原文链接:https://www.f2er.com/note/422402.html

猜你在找的程序笔记相关文章