ColorPicker icon indicating copy to clipboard operation
ColorPicker copied to clipboard

ColorPickerDialog.newBuilder() creates a DialogFragment instead of a Dialog, encouraging memory leaks

Open AndroidDeveloperLB opened this issue 3 years ago • 0 comments

It creates "ColorPickerDialog extends DialogFragment" , so when I use this:

val dialog: ColorPickerDialog = ColorPickerDialog.newBuilder().....create()

I can actually call now dialog.setColorPickerDialogListener , which has the scope of the current class, and that's usually an Actvity/Fragment.

This can lead to memory leaks and reaching things that are destroyed.

Please offer an alternative which is a real Dialog, instead.

AndroidDeveloperLB avatar Feb 15 '23 15:02 AndroidDeveloperLB