F
F
foonfyrick2021-01-23 18:47:41
Android
foonfyrick, 2021-01-23 18:47:41

Removing references to listeners and objects?

1. I have a date class, it is marked @Parcelize, in the profiler, after I pressed the back arrow on the emulator, called the collector, and made a dump, I still have Model$Creator, how to delete it correctly and what is the creator?
2. I have a singleton arraylist, it is filled with these models, this array is also marked as a non-deleted object, does it just need to be nullified? arraylist = null ?
3. I have an interface with listeners that I made for the recyclerView to click on the elements, it’s not at all clear here, I have it marked in the garbage collector in two fragments, is it possible to cancel them somehow? I have them in the viewholder in the function, I can set null in the parameters, but there is no onDestroy in the adapter

fun setClickListeners(){
            itemView.setOnClickListener(this)
            itemView.setOnLongClickListener(this)
        }

Or do I need to reset the adapter?
And in general, when the application is minimized, 100% should all links be deleted, or is there something that cannot and should not be deleted? Is it reasonable, then, to make all variables nullable in general, so that later in onDestroy () simply assign null to everything?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question