Open enriquebautista opened 3 years ago
Yes, Of course you need to clean the memory ( from variable that reference the binding). Reason: Because you instantiate the variable binding, by fragment being destroyed you need to free it ( assign it null ).
can i work on this issu ?
this is my first contribution
From Official docs: Fragments outlive their views. Make sure you clean up any references to the binding class instance in the fragment's onDestroyView() method.
My question is the following:
` public class SomeDialogFragment extends AppCompatDialogFragment {
private DialogSomeBinding binding;
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { binding = DialogSomeBinding.inflate(LayoutInflater.from(requireContext())); return new MaterialDialog.Builder(requireContext()) .customView(binding.getRoot(), false) .build(); }
// This part is necessary even if you don't use onCreateView? @Override public void onDestroyView() { binding = null; super.onDestroyView(); }
} `