In fact, not one. In the application, there is an activation at the start - it is also a stub, while data is being received from the server, the second is an error message about connecting to the Internet, I show it only with errors. The third and main container is for many fragments that I manage with NavigationDrawer. At that moment, when the main activity is loaded, there is no chance that I will see the other two before restarting the application (they exist only at the start). Is it permissible in this case to store a static copy of the activation in it itself? To initialize, say, in onCreate (a can be both reset and reinitialized when it goes into the background and returns from there). Or is it a bad idea anyway?

UPD

Transferring the link to this instance, let's say in the adapter and storing it in a non-static field, do we make this adapter unkillable for GC or not?

  • 2
    And why do you need a static link to the activation inside the activation? In any case, the link to the activation is available as well, and the presence of static fields in the activation on non-primitive data is the source of numerous errors. - KoVadim
  • for some reason, as the new build version comes out (my guess), a lot of things in the project began to change. It began with the fact that in some places the markup went, and in some places getActivity () or getContext () in the fragment began to return null. Objectively, I will revise it, but at the moment it is in the release and users cannot use the application, which causes a lot of negative emotions. Therefore, I want to understand whether such a decision is permissible at least temporarily - iamthevoid
  • @iamthevoid, most likely you just need to roll back to versions where everything was stable. New versions - always new bugs. And about getContext in the enemy, look here - the contest (and activating from it) is better to get in the corresponding method of the life cycle - JuriySPb

0