Issue
I have a 56 drawable in my res folder.
I use them in 2 Fragments.
Is it a good memory approach to create a class that has a static array containing those drawables and call its get method whenever I want to use it?
Or Should I create a private array in each Fragment?
Solution
you should create private arrays in the fragment. Having them all in another class will means they will never get destroyed even when your not using them taking up memory. In addition static arrays will get deleted when the app goes into the background for too long, so you would need extra code to reload the array when is resumed if the array is null
Answered By - Tomer Shemesh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.