StikkyHeader
StikkyHeader copied to clipboard
How to release memory
I ran your example and found that, when I click on tab "Simple stickky header" then I press back to home screen, the memory usage increase (Seen on Android Studio IDE -> Monitor -> Memory Allocated). Then -> click the same tab -> back to home .... memory increase continuously. How to release this memory? Thank you very much!
I found that the issue is caused by getViewTreeObserver().addOnGlobalLayoutListener(), the listener is not freed by garbage collector. (Refer to: http://stackoverflow.com/questions/28264139/view-getviewtreeobserver-addongloballayoutlistener-leaks-fragment). I fixed the RecyclerStikkyFragment example by making some changes on 3 files: StikkyHeader.java StikkyHeaderBuilder.java RecyclerStikkyFragment.java If you interested in the issue, please refer to my fork: https://github.com/ancuop/StikkyHeader