Open fajaranugrah opened 5 years ago
Put it in a variable and then check if its already displayed and then close it and recreate it, or just do nothing.
Something like this:
Button button = (Button) findViewById(R.id.buttonDate);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (datePickerDialog != null && !datePickerDialog.isDisplayed()) {
datePickerDialog = new SingleDateAndTimePickerDialog.Builder(this)
.bottomSheet()
.curved()
.displayMinutes(false)
.displayHours(false)
.displayDays(false)
.displayMonth(true)
.displayYears(true)
.displayDaysOfMonth(true)
.build();
datePickerDialog.display();
}
}
});
Hello i get problem
and then i click the Button, i get show dialog twice how i resolve this? Thank you